Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Sub ScanDirectoryAndImport(Optional ByVal Path As String)
'Define the Source and Destination table names here
Const strcSource As String = "[i]Table1[/i]"
Const strcDestination As String = "[i]Table2[/i]"
'See if a path was provided, if not assume current db directory
Dim strPath As String, strFile As String
If Path = "" Then
strPath = CurrentProject.Path
Else
strPath = Path
End If
'Make sure the syntax is correct
If Right$(strPath, 1) <> "\" Then strPath = strPath & "\"
strFile = Dir$(strPath & "*.mdb")
'DoCmd.SetWarnings False
Do While strFile <> ""
DoCmd.TransferDatabase acImport, , strPath & strFile, _
acTable, strcSource, strcDestination
strFile = Dir$
Loop
'DoCmd.SetWarnings True
End Sub