strTitle = “Jobs imported”
strPrompt = “New jobs imported into tblJobs from “ _
& GetAppFile()
MsgBox strPrompt, vbInformation + vbOKOnly, strTitleErrorHandlerExit:
Exit SubErrorHandler:
MsgBox “Error No: “ & Err.Number _
& “; Description: “ & Err.Description
Resume ErrorHandlerExitEnd SubThe Source File button’s event procedure opens a File Picker dialog for selecting an application file for
importing, filtering for dBASE, Paradox, or Lotus files depending on the option selected on the form:
Private Sub cmdSourceFile_Click()On Error GoTo ErrorHandlerDim fd As Office.FileDialog
Dim txt As Access.TextBox
Dim strPath As String
Dim strFilter As StringCreate a FileDialogobject as a File Picker dialog box.
Set fd = Application.FileDialog(msoFileDialogFilePicker)
Set txt = Me![txtSelectedAppFile]Set the initial path to the custom Input Documents path
strPath = GetInputDocsPath()
intFileType = Nz(Me![fraFileType].Value, 1)With fd
.title = “Select database or spreadsheet file with “ _
& “job data to import”
.ButtonName = “Select”
.Filters.ClearSelect Case intFileTypeCase 1
.Filters.Add “dBASE files”, “*.dbf”Working with External Data 10
