J
Johnny Bright
Hi there,
I'm running the following code:
Private Sub Report_Open(Cancel As Integer)
Select Case Forms![frmReports]![optChooseReport]
Case 1
Me.RecordSource = "qryRptCategory"
Case 2
Me.RecordSource = "qryRptSubCategory"
Case Else
Me.RecordSource = "qryAllProds"
End Select
If Me.RecordSource.RecordCount = 0 Then
Cancel = True
MsgBox "No products were found. Please try another category",
vbOKOnly, "No Samples"
End If
End Sub
So, what I want to do is if there are no records, cancel and give me a msg
box but all it's doing is cancelling the report operation. What am I doing
wrong?
Thanks!
I'm running the following code:
Private Sub Report_Open(Cancel As Integer)
Select Case Forms![frmReports]![optChooseReport]
Case 1
Me.RecordSource = "qryRptCategory"
Case 2
Me.RecordSource = "qryRptSubCategory"
Case Else
Me.RecordSource = "qryAllProds"
End Select
If Me.RecordSource.RecordCount = 0 Then
Cancel = True
MsgBox "No products were found. Please try another category",
vbOKOnly, "No Samples"
End If
End Sub
So, what I want to do is if there are no records, cancel and give me a msg
box but all it's doing is cancelling the report operation. What am I doing
wrong?
Thanks!