Application.CurrentProject.ImportExportSpecifications(strSpec).
Execute‘Old style syntax causes error
‘DoCmd.TransferText transfertype:=acImportFixed, _
specificationname:=strSpec, _
TableName:=strTable, _
FileName:=strTextFile, _
hasfieldnames:=TrueEnd SelectAssign table as the subform’s source object.
Me![subNewJobs].SourceObject = “fsubNewJobs”ErrorHandlerExit:
Exit SubErrorHandler:
MsgBox “Error No: “ & Err.Number _
& “; Description: “ & Err.Description
Resume ErrorHandlerExitEnd SubThe “Save New Jobs to Table” command button’s event procedure runs an append query that adds
the selected jobs to tblNewJobs:
Private Sub cmdSaveJobs_Click()On Error GoTo ErrorHandlerDoCmd.SetWarnings False
DoCmd.OpenQuery “qappNewJobs”
strTitle = “Jobs imported”
strPrompt = “New jobs imported into tblJobs from “ _
& GetTextFile()
MsgBox strPrompt, vbInformation + vbOKOnly, strTitleErrorHandlerExit:
Exit SubErrorHandler:
MsgBox “Error No: “ & Err.Number _
& “; Description: “ & Err.Description
Resume ErrorHandlerExitEnd SubWorking with External Data 10