B
Bonnie
Hi there! Using A02 on XP. Have queried records meeting
criteria for Reminder1 reports. Each belongs to a pricing
structure SA02, SA03 or SA04. May be 23 of one, 5 of
another or even zero. Reminder1 has a report for each
pricing structure (old story). Each report's OnNoData
event shows a message and the report doesn't open if there
are no records for that reminder.
My form has a button (see code below). Problem is this: if
the first or second report has zero records, you get the
nice little message about NoData but as soon as you click
Okay, you get the OpenReportActionCancelled goodie and
even if the next report in line has data, you are out of
luck. How can I put something like the OnNoData code in my
button's OnClick event so it will move to the next report?
Luv U Guys, 1 N All. Always been a great help to me.
Thanks in advance for any help or advice.
Private Sub Rem1_Click()
If CurrentUser() <> "BWA" And CurrentUser() <> "PLG"
And CurrentUser() <> "VRS" Then
MsgBox "You are not authorized to open these reports."
DoCmd.Close
Else
On Error GoTo Err_Rem1_Click
Dim stDocName As String
stDocName = "RPSAdminFeeBillReminder1SA02"
DoCmd.OpenReport stDocName, acPreview
DoCmd.RunCommand acCmdZoom75
stDocName = "RPSAdminFeeBillReminder1SA03"
DoCmd.OpenReport stDocName, acPreview
DoCmd.RunCommand acCmdZoom75
stDocName = "RPSAdminFeeBillReminder1SA04"
DoCmd.OpenReport stDocName, acPreview
DoCmd.RunCommand acCmdZoom75
Exit_Rem1_Click:
Exit Sub
Err_Rem1_Click:
MsgBox Err.Description
Resume Exit_Rem1_Click
End If
End Sub
criteria for Reminder1 reports. Each belongs to a pricing
structure SA02, SA03 or SA04. May be 23 of one, 5 of
another or even zero. Reminder1 has a report for each
pricing structure (old story). Each report's OnNoData
event shows a message and the report doesn't open if there
are no records for that reminder.
My form has a button (see code below). Problem is this: if
the first or second report has zero records, you get the
nice little message about NoData but as soon as you click
Okay, you get the OpenReportActionCancelled goodie and
even if the next report in line has data, you are out of
luck. How can I put something like the OnNoData code in my
button's OnClick event so it will move to the next report?
Luv U Guys, 1 N All. Always been a great help to me.
Thanks in advance for any help or advice.
Private Sub Rem1_Click()
If CurrentUser() <> "BWA" And CurrentUser() <> "PLG"
And CurrentUser() <> "VRS" Then
MsgBox "You are not authorized to open these reports."
DoCmd.Close
Else
On Error GoTo Err_Rem1_Click
Dim stDocName As String
stDocName = "RPSAdminFeeBillReminder1SA02"
DoCmd.OpenReport stDocName, acPreview
DoCmd.RunCommand acCmdZoom75
stDocName = "RPSAdminFeeBillReminder1SA03"
DoCmd.OpenReport stDocName, acPreview
DoCmd.RunCommand acCmdZoom75
stDocName = "RPSAdminFeeBillReminder1SA04"
DoCmd.OpenReport stDocName, acPreview
DoCmd.RunCommand acCmdZoom75
Exit_Rem1_Click:
Exit Sub
Err_Rem1_Click:
MsgBox Err.Description
Resume Exit_Rem1_Click
End If
End Sub