No Records Msgbox stopped working

Oscar_W

Registered User.
Local time
Today, 16:06
Joined
Mar 9, 2006
Messages
42
I am calling a continous form from a combo box on another form. The code below used to warn me that there were no records and shut the form down to avoid showing a blank form.

Code:
Private Sub Form_Load()

If IsNull(Me.TxtUnit) Then
MsgBox "There are no operations recorded for this Unit", vbOKOnly, "No Recorded Operations"
DoCmd.Close
End If

End Sub

All was working fine until I changed the properties of the continous form to "Allow Additions = No" to remove the spare blank line at the bottom of the records (just for neatness really).
Now, if there are no records to display, the Me.TxtUnit is not Null anymore. It does not seem to exist. If I hover the mouse over it (in VBA) I get no response at all.

How can I get my Msgbox back please ?

Oscar
 
Try:
Code:
  If Me.RecordsetClone.RecordCount = 0 Then
    MsgBox "none"
    DoCmd.Close
  End If
 
Pbaldy,

Many thanks.
 

Users who are viewing this thread

Back
Top Bottom