Hi Hendrick!
The MyImportsDrive() function, just replace the drive of the path of your saved imports, doesn't execute them.
With your button, you just need to execute the saved import-export like bellow:
Code:
CurrentProject.ImportExportSpecifications.item("Import-tblSynonymsADD").Execute
(for the first saved import)
and
Code:
CurrentProject.ImportExportSpecifications.item("Import-Blokkiesadd").Execute
(for the second saved import)
or with a generic procedure like this:
Code:
Sub ExecuteMyImports()
Dim IES As ImportExportSpecification
For Each IES In CurrentProject.ImportExportSpecifications
With CurrentProject.ImportExportSpecifications
Select Case MsgBox("Do you want to execute the '" & IES.Name & "' saved import-export specification?", vbQuestion + vbYesNoCancel)
Case vbCancel
'Abort any next execution.
Exit For
Case vbYes
'Execute current saved import-export spec and step to the next.
IES.Execute
Case Else
'Abort the execution of the current saved import-export spec and step to the next.
End Select
End With
Next IES
End Sub
Put it in a code module (if you like in the same module with the MyImportsDrive() function), and then, you can call it via your button(s) as seems bellow:
Code:
Private Sub btnmake_sintbl_Click()
Call ExecuteMyImports
End Sub
I hope it helps.
Cheers,
John