Lynn,
Thanks for bearing with me. I made the following changes with the same
result. The program appears to skip right over the procedure. Maybe I
totally misunderstood your instruction.
HERE'S THE FUNCTION:
Sub 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 Sub
HERE'S THE CALL:
MsgBox "ready to import"
DoCmd.OpenModule "modItemImport"
MsgBox "Returned from the Import function."
"Lynn Trapp" wrote:
> Well, silly me. A function requires an assignment statement. You should
> change your code to a procedure.
>
> --
> Lynn Trapp
> MS Access MVP
> www.ltcomputerdesigns.com
> Access Security: www.ltcomputerdesigns.com/Security.htm
> Jeff Conrad's Access Junkie List:
> http://home.bendbroadband.com/conrad...essjunkie.html
>
>
>
> "Dorci" <(E-Mail Removed)> wrote in message
> news:5A9822F0-F528-4387-AAA4-(E-Mail Removed)...
> > When I do that, I get an error message:
> > Compile error: Unexpected: =
> >
> >
> > "Lynn Trapp" wrote:
> >
> >> Try simply calling your function.
> >>
> >> MsgBox "ready to import"
> >> ItemImport()
> >> MsgBox "Returned from the Import function."
> >>
> >>
> >> --
> >> Lynn Trapp
> >> MS Access MVP
> >> www.ltcomputerdesigns.com
> >> Access Security: www.ltcomputerdesigns.com/Security.htm
> >> Jeff Conrad's Access Junkie List:
> >> http://home.bendbroadband.com/conrad...essjunkie.html
> >>
> >>
> >>
> >> "Dorci" <(E-Mail Removed)> wrote in message
> >> news:64E8C3E3-B1E3-4202-9171-(E-Mail Removed)...
> >> > 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."
> >> >
> >>
> >>
> >>
>
>
>