strTitle = “Exported jobs”
strPrompt = “Exported filtered jobs to “ & strTextFile
MsgBox strPrompt, vbInformation + vbOKOnly, strTitle
ErrorHandlerExit:
Exit Sub
ErrorHandler:
MsgBox “Error No: “ & Err.Number _
& “; Description: “ & Err.Description
Resume ErrorHandlerExit
End Sub
The “Inspect New Jobs to Export” button’s event procedure sets the form datasheet’s source object
to the subform bound to qryFilteredJobs, to display the selected jobs:
Private Sub cmdInspectNewJobs_Click()
On Error Resume Next
Me![subFilteredJobs].SourceObject = “fsubFilteredJobs”
End Sub
Working with Legacy Database and Spreadsheet Files ......................................................
Since the earliest days of Access (when dBASE and Paradox were major forces in the database
world, and Lotus 1-2-3 was the leading spreadsheet application) Access could import from or
export to these formats. Some people are still using these programs, or at least have old files cre-
ated by them in past years, so you still might need to import data from a dBASE, Paradox, or Lotus
file or (though it’s much less likely) export to one of those formats. Access still supports importing
from these legacy formats, and you can also export to them, both in the interface and in VBA code.
Importing Database Files ........................................................................................
The form for importing data from legacy application files is similar to the form for importing from
text files; it differs in offering a selection of three legacy application types: dBASE, Paradox, and
Lotus. The following steps describe importing Jobs data from a dBASE file:
Part II Writing VBA Code to Exchange Data between Office Components