K
Konchetta via AccessMonster.com
Greetings All!
I have researched this site to find my problem but can't find a resolution.
My problem is that I have various reports and parameter queries for which I
want to use one Dialog Box which prompts the user to enter the beginning and
ending Fiscal Year. I was about to resort to creating a dialog box form for
each report but i'm sure there is a simpler way to do this. I have the
coding for my OK button of my Form below for one specific report but how
should it be coded so that more than one report can use this dialog box. Or
should there be coding for each report somewhere-else? I hope I am stating
this correctly.
Any assistance would be GREATLY appreciated!
Private Sub OK_Click()
On Error GoTo Err_OK_Click
Dim strMsg As String, strTitle As String
Dim intStyle As Integer
' If Audit Information - 202 report is not being opened for previewing or
printing,
' cause an error. (blnOpening variable is true only when report's Open
event
' is being executed.)
If Not Reports![Audit Information - 202].blnOpening Then Err.Raise 0
' Hide form.
Me.Visible = False
Exit_OK_Click:
Exit Sub
Err_OK_Click:
strMsg = "To use this form, you must preview or print the Audit
Information - 202 Reports from the Database window or Design view."
intStyle = vbOKOnly
strTitle = "Open from Report"
MsgBox strMsg, intStyle, strTitle
Resume Exit_OK_Click
End Sub
I have researched this site to find my problem but can't find a resolution.
My problem is that I have various reports and parameter queries for which I
want to use one Dialog Box which prompts the user to enter the beginning and
ending Fiscal Year. I was about to resort to creating a dialog box form for
each report but i'm sure there is a simpler way to do this. I have the
coding for my OK button of my Form below for one specific report but how
should it be coded so that more than one report can use this dialog box. Or
should there be coding for each report somewhere-else? I hope I am stating
this correctly.
Any assistance would be GREATLY appreciated!
Private Sub OK_Click()
On Error GoTo Err_OK_Click
Dim strMsg As String, strTitle As String
Dim intStyle As Integer
' If Audit Information - 202 report is not being opened for previewing or
printing,
' cause an error. (blnOpening variable is true only when report's Open
event
' is being executed.)
If Not Reports![Audit Information - 202].blnOpening Then Err.Raise 0
' Hide form.
Me.Visible = False
Exit_OK_Click:
Exit Sub
Err_OK_Click:
strMsg = "To use this form, you must preview or print the Audit
Information - 202 Reports from the Database window or Design view."
intStyle = vbOKOnly
strTitle = "Open from Report"
MsgBox strMsg, intStyle, strTitle
Resume Exit_OK_Click
End Sub