Display Blank Form

esskaykay

Registered User.
Local time
Today, 07:19
Joined
Mar 8, 2003
Messages
267
I have a DB with a form based on a query where we keyin a parcel identification number (PIN). If there is a corresponding PIN the form opens. If there is no PIN available, a blank form appears. Is there a way that if no corresponding PIN is found, a different form or message box would open stating "No parcel available"?

Thanks,
SKK
 
Searching would have found something like this...
Code:
Private Sub Form_Open(Cancel As Integer)
    
    If Me.RecordsetClone.RecordCount = 0 Then
        MsgBox "There are zero records in the data source!", vbInformation, "No Records Found"
        DoCmd.Close acForm, Me.name
    End If
    
End Sub
 
You could try running a DCount on the query or your table prior to running the query to make sure there are related records.

Another option would be to use a combo box containing all of the PINs and select the limit to list property so only a legitimate PIN can be selected.
 
I will try and let you know how successful I am.

Thanks all,
SKK
 
Excellent ghudson....
Exactly what I wanted.

Thanks again,
SKK
 
Your welcome.

Another satisfied customer! :D
 

Users who are viewing this thread

Back
Top Bottom