View Full Version : No Records


Webmaster@worksnotfun.com
01-29-2002, 04:14 AM
I have a form, that control source is a parameter query. The query asks for a report no. So if the user, hits return, or ok, the form opens to a blank record. How would I change this to say "No records found, please reenter the number". I've played with the OnError event, and the user can still select OK, and it opens to a blank record.

Rich
01-29-2002, 04:28 AM
Private Sub Form_Open(Cancel As Integer)
On Error GoTo Macro11_Err
If (RecordsetClone.RecordCount = 0) Then
DoCmd.Close
Beep
MsgBox "There are no invoices recorded for that period.", vbInformation, "No Invoices Recorded"
End If



Macro11_Exit:
Exit Sub

Macro11_Err:
MsgBox Error$
Resume Macro11_Exit
End Sub