Checking if a form has data

ChristopherM

Registered User.
Local time
Today, 13:02
Joined
Jan 5, 2000
Messages
38
I am sure this is pretty simple but I cannot figure out how to check if the data source for a form (query) is returning any data at the form's On Load event. I have tried using HasData but it seems only to apply to reports. Can anyone help? Thanks
 
Found the answer in the Archives

Private Sub Form_Open(Cancel As Integer)
If Me.RecordsetClone.RecordCount = 0 Then
MsgBox " No record found", vbOKOnly
Cancel = True
Exit Sub
End If

End Sub



[This message has been edited by jwindon (edited 09-22-2001).]
 
Thanks for your help.
 

Users who are viewing this thread

Back
Top Bottom