G
Guest
I am trying build a function, where a report can run, and is filtered by user
inputting a parameter in a inputbox.
This does not work; it still prompts for the parmater from the underlying
query
prmQuote is a text field, specified on the underlying query behind the report
also generates an error message ...no n umber, but "The expressioin is
typoed incorrectly". This occurs on the first "DoCmd.OpenReport ..."
Any help is appreciated
Code is as follows
Option Compare Database
Option Explicit
Public strDocName As String
Public strWhere As String
Function Internal_Report()
On Error GoTo Err_Internal_Report
strWhere = "[prmQuote] = " & InputBox("Enter Quote Number")
strDocName = "rpt_Approval_Summary"
DoCmd.OpenReport strDocName, acPreview, , strWhere
strDocName = "rpt_ExplodedBOM"
DoCmd.OpenReport strDocName, acPreview
strDocName = "rpt_approval"
DoCmd.OpenReport strDocName, acPreview
Exit_Internal_Report:
Exit Function
Err_Internal_Report:
MsgBox Err.Description
Resume Exit_Internal_Report
End Function
inputting a parameter in a inputbox.
This does not work; it still prompts for the parmater from the underlying
query
prmQuote is a text field, specified on the underlying query behind the report
also generates an error message ...no n umber, but "The expressioin is
typoed incorrectly". This occurs on the first "DoCmd.OpenReport ..."
Any help is appreciated
Code is as follows
Option Compare Database
Option Explicit
Public strDocName As String
Public strWhere As String
Function Internal_Report()
On Error GoTo Err_Internal_Report
strWhere = "[prmQuote] = " & InputBox("Enter Quote Number")
strDocName = "rpt_Approval_Summary"
DoCmd.OpenReport strDocName, acPreview, , strWhere
strDocName = "rpt_ExplodedBOM"
DoCmd.OpenReport strDocName, acPreview
strDocName = "rpt_approval"
DoCmd.OpenReport strDocName, acPreview
Exit_Internal_Report:
Exit Function
Err_Internal_Report:
MsgBox Err.Description
Resume Exit_Internal_Report
End Function