Displaying a message box when a form is blank

drisconsult

Drisconsult
Local time
Today, 04:00
Joined
Mar 31, 2004
Messages
125
Hello All

I have a parameter query that opens a report. I have a parameter query that opens a form.

I am aware of the On No Data property available for providing a message box when a teacher enters a class into a parameter query and the report is empty.

Is there such a procedure for providing a message box when the teacher enters a class into a parameter query and the form is empty?

I would like to display a message box that informs the teacher that the class does not exist rather than load the form with blank fields.

Kind Regards
Terence
London
 
If RecordsetClone.RecordCount = 0 Then
MsgBox " Your text"
DoCmd.Close acForm, Me.Name

End If
 
No Data on Form

Use the Code given by Rich within the Form_Open Event Procedure.


Private Sub Form_Open(Cancel As Integer)

End Sub
 

Users who are viewing this thread

Back
Top Bottom