S
Sash
I'm trying to allow the user to load another file by using the following
code, but I get type miss match on the first line.
Do While VbMsgBoxResult = vbYes
With Application.FileDialog(msoFileDialogFilePicker)
.Title = "Select Import File"
.Filters.Add "Text", "*.txt"
.Filters.Add "All Files", "*.*"
.FilterIndex = 1
.AllowMultiSelect = False
.InitialFileName = "\c:InputFiles/"
result = .Show
If (result <> 0) Then
fileName = Trim(.SelectedItems.Item(1))
End If
End With
'Trim File Header
Call TrimFileHeaderX(fileName, 1)
'Load with Specs
stSpecs = "ABCCompany"
sttable = "tblABC"
stfilename = fileName
DoCmd.SetWarnings False
DoCmd.TransferText acImportDelim, stSpecs, sttable, stfilename
DoCmd.SetWarnings True
'Ask Another Import if so, GOTO GetFile and loop until user says NO
VbMsgBoxResult = MsgBox("Load Another File?", vbYesNo)
Loop
code, but I get type miss match on the first line.
Do While VbMsgBoxResult = vbYes
With Application.FileDialog(msoFileDialogFilePicker)
.Title = "Select Import File"
.Filters.Add "Text", "*.txt"
.Filters.Add "All Files", "*.*"
.FilterIndex = 1
.AllowMultiSelect = False
.InitialFileName = "\c:InputFiles/"
result = .Show
If (result <> 0) Then
fileName = Trim(.SelectedItems.Item(1))
End If
End With
'Trim File Header
Call TrimFileHeaderX(fileName, 1)
'Load with Specs
stSpecs = "ABCCompany"
sttable = "tblABC"
stfilename = fileName
DoCmd.SetWarnings False
DoCmd.TransferText acImportDelim, stSpecs, sttable, stfilename
DoCmd.SetWarnings True
'Ask Another Import if so, GOTO GetFile and loop until user says NO
VbMsgBoxResult = MsgBox("Load Another File?", vbYesNo)
Loop