D
Dorci
Access 2003 - I have a module function that works just fine when I call it
from a macro (using the RunCode action). However, when I call it from code,
some screens splash by quickly, then the code moves on to the next step.
Adding Msgboxes to the function didn't even slow it down to let me see what's
happening. Any ideas?
HERE'S THE FUNCTION:
Function ItemImport()
Dim strFilter As String
Dim strInputFileName As String
strFilter = ahtAddFilterItem(strFilter, "Excel Files (*.XLS)", "*.XLS")
strInputFileName = ahtCommonFileOpenSave( _
Filter:=strFilter, OpenFile:=True, _
DialogTitle:="Please select an input file...", _
Flags:=ahtOFN_HIDEREADONLY)
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel97,
"tblItemImport", strInputFileName, True
End Function
HERE'S THE CALL:
MsgBox "ready to import"
DoCmd.OpenModule "modItemImport"
MsgBox "Returned from the Import function."
from a macro (using the RunCode action). However, when I call it from code,
some screens splash by quickly, then the code moves on to the next step.
Adding Msgboxes to the function didn't even slow it down to let me see what's
happening. Any ideas?
HERE'S THE FUNCTION:
Function ItemImport()
Dim strFilter As String
Dim strInputFileName As String
strFilter = ahtAddFilterItem(strFilter, "Excel Files (*.XLS)", "*.XLS")
strInputFileName = ahtCommonFileOpenSave( _
Filter:=strFilter, OpenFile:=True, _
DialogTitle:="Please select an input file...", _
Flags:=ahtOFN_HIDEREADONLY)
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel97,
"tblItemImport", strInputFileName, True
End Function
HERE'S THE CALL:
MsgBox "ready to import"
DoCmd.OpenModule "modItemImport"
MsgBox "Returned from the Import function."