G
Guest
I want to allow a user browse a file and after the file is selected, I want
that file to be imported into a table. This is all in access 2000.
Right now, after the user selects the file to import, I get an run-time
error 2522: "the action or method requires a file name argument"
I know that the standard transfertext command asks for a file name in the
argument, but in this case, I want the file that was selected by the user to
be imported. That file name may change each import.
Please help - as you can tell, I am very green on VB. I have searched all
the help files I can find - no luck so far.
Here is my code:
Private Sub cmdFileDialog_Click()
Dim strFilter As String
Dim strInputFileName As String
strFilter = ahtAddFilterItem(strFilter, "Tab Files (*.tab)", "*.tab")
strInputFileName = ahtCommonFileOpenSave( _
Filter:=strFilter, OpenFile:=True, _
DialogTitle:="Please select an input file...", _
Flags:=ahtOFN_HIDEREADONLY)
DoCmd.TransferText acExportDelim, "Alibris Import specification",
"AlibrisImportTable", ""
End Sub
that file to be imported into a table. This is all in access 2000.
Right now, after the user selects the file to import, I get an run-time
error 2522: "the action or method requires a file name argument"
I know that the standard transfertext command asks for a file name in the
argument, but in this case, I want the file that was selected by the user to
be imported. That file name may change each import.
Please help - as you can tell, I am very green on VB. I have searched all
the help files I can find - no luck so far.
Here is my code:
Private Sub cmdFileDialog_Click()
Dim strFilter As String
Dim strInputFileName As String
strFilter = ahtAddFilterItem(strFilter, "Tab Files (*.tab)", "*.tab")
strInputFileName = ahtCommonFileOpenSave( _
Filter:=strFilter, OpenFile:=True, _
DialogTitle:="Please select an input file...", _
Flags:=ahtOFN_HIDEREADONLY)
DoCmd.TransferText acExportDelim, "Alibris Import specification",
"AlibrisImportTable", ""
End Sub