The “Export Jobs to Text File” button’s event procedure sets up a Select Casestatement to
export the selected jobs, using the TransferTextstatement with different arguments:
Private Sub cmdExportJobs_Click()On Error GoTo ErrorHandlerDim intTextType As Integer
Dim strQuery As String
Dim strTextFile As String
Dim strTitle As String
Dim strPrompt As StringintTextType = Nz(Me![fraTextType].Value, 1)
strQuery = “qryFilteredJobs”Select Case intTextTypeCase 1Comma-delimited
strTextFile = GetOutputDocsPath() _
&”Filtered Jobs.csv”
DoCmd.TransferText transfertype:=acExportDelim, _
TableName:=strQuery, _
FileName:=strTextFile, _
hasfieldnames:=TrueCase 2Fixed-width
strTextFile = GetOutputDocsPath() _
&”Filtered Jobs.txt”
strSpec = “Export@@hyFilteredJobs”
strTextFile = GetOutputDocsPath() & “Filtered Jobs.txt”
‘New style syntaxApplication.CurrentProject.ImportExportSpecifications(strSpec).Ex
ecute‘Old style syntax causes error
‘DoCmd.TransferText transfertype:=acExportFixed, _
TableName:=strQuery, _
FileName:=strTextFile, _
hasfieldnames:=TrueEnd SelectWorking with External Data 10