to usando o codigo abaixo para importar dados de outra tabela, mas ele importar a tabela toda, quero somente atualizar a tabela, alguem pode me ajudar
Option Compare Database
Sub ImportAllTbls(sExtDbPath As String)
On Error GoTo Error_Handler
Dim db As DAO.Database
Dim tdf As DAO.TableDef
Set db = OpenDatabase(sExtDbPath)
For Each tdf In db.TableDefs
If Left(tdf.Name, 4) <> "MSys" Then
On Error Resume Next
Access.DoCmd.TransferDatabase acImport, "Microsoft Access", sExtDbPath, _
acTable, tdf.Name, tdf.Name, False
End If
Next tdf
db.Close
Set db = Nothing
Exit Sub
Error_Handler:
MsgBox "MS Access has generated the following error" & vbCrLf & vbCrLf & "Error Number: " & _
Err.Number & vbCrLf & "Error Source: ImportAllTbls" & vbCrLf & "Error Description: " & _
Err.Description, vbCritical, "An Error has Occured!"
Exit Sub
End Sub
Option Compare Database
Sub ImportAllTbls(sExtDbPath As String)
On Error GoTo Error_Handler
Dim db As DAO.Database
Dim tdf As DAO.TableDef
Set db = OpenDatabase(sExtDbPath)
For Each tdf In db.TableDefs
If Left(tdf.Name, 4) <> "MSys" Then
On Error Resume Next
Access.DoCmd.TransferDatabase acImport, "Microsoft Access", sExtDbPath, _
acTable, tdf.Name, tdf.Name, False
End If
Next tdf
db.Close
Set db = Nothing
Exit Sub
Error_Handler:
MsgBox "MS Access has generated the following error" & vbCrLf & vbCrLf & "Error Number: " & _
Err.Number & vbCrLf & "Error Source: ImportAllTbls" & vbCrLf & "Error Description: " & _
Err.Description, vbCritical, "An Error has Occured!"
Exit Sub
End Sub