T
Tony Williams
I have created a batch file following the instructions from a post by Albert
Kallal to run a routine that prints a report. Here is my script:
dim accessApp
set accessApp = createObject("Access.Application")
accessApp.OpenCurrentDataBase("C:\Documents and Settings\Owner\My
Documents\TimeandBilling.mdb")
accessApp.Run "macinvoice"
accessApp.Quit
set accessApp = nothing
The module in the mdb file is called macinvoice and this is the code:
Option Compare Database
'------------------------------------------------------------
' macinvoice
'
'------------------------------------------------------------
Function macinvoice()
On Error GoTo macinvoice_Err
DoCmd.OpenReport "Invoice List", acViewPreview, "", "", acNormal
macinvoice_Exit:
Exit Function
macinvoice_Err:
MsgBox Error$
Resume macinvoice_Exit
End Function
However when I click on the script icon Access opens at the right database
but I get an error message that says it can't find the procedure 'macinvoice'
even though the module is listed as macinvoice.
I must admit to being a little out of my depth here so can anyone help?
Thanks
Tony
Kallal to run a routine that prints a report. Here is my script:
dim accessApp
set accessApp = createObject("Access.Application")
accessApp.OpenCurrentDataBase("C:\Documents and Settings\Owner\My
Documents\TimeandBilling.mdb")
accessApp.Run "macinvoice"
accessApp.Quit
set accessApp = nothing
The module in the mdb file is called macinvoice and this is the code:
Option Compare Database
'------------------------------------------------------------
' macinvoice
'
'------------------------------------------------------------
Function macinvoice()
On Error GoTo macinvoice_Err
DoCmd.OpenReport "Invoice List", acViewPreview, "", "", acNormal
macinvoice_Exit:
Exit Function
macinvoice_Err:
MsgBox Error$
Resume macinvoice_Exit
End Function
However when I click on the script icon Access opens at the right database
but I get an error message that says it can't find the procedure 'macinvoice'
even though the module is listed as macinvoice.
I must admit to being a little out of my depth here so can anyone help?
Thanks
Tony