No data property on form

sdawson

Registered User.
Local time
Today, 20:01
Joined
Apr 22, 2003
Messages
165
I have a form based on a Find Unmatched Query.
I need the functionality of the No Data event found on reports to launch a message or cancel the Open Form event.
How can I do this on a form?

Ta
 
Something like this, maybe?

This will simply display a messagebox, then close when OK is pressed
Code:
Private Sub Form_Load()

If Me.Recordset.RecordCount < 1 Then
  MyMsg = MsgBox("There Are No Records!", vbOKOnly, "No Records!")
  DoCmd.Close
End If

End Sub
This will let the form show briefly, them popup a messagebox, then close everything when OK is clicked on in the messagebox
Code:
Private Sub Form_Load()
  If Me.Recordset.RecordCount < 1 Then Me.TimerInterval = 1000
End Sub
Code:
Private Sub Form_Timer()
  MyMsg = MsgBox("There Are No Records!", vbOKOnly, "No Records!")
  Me.TimerInterval = 0
  DoCmd.Close
End Sub
 
Last edited:
Man what a star.
Thanx Missinglinq.
If you were in the UK, I'de buy you a pint!
 

Users who are viewing this thread

Back
Top Bottom