Problem with isnull

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm trying to close a form if there's no underlying data in the table. My
code:

Private Sub Form_Dirty(Cancel As Integer)
If IsNull(Me.Old_Check) = True Then DoCmd.Close
End Sub

Not working - please help!!

Thanks
 
If you want to block the form from loading when there are no records, cancel
its Open event:

Private Sub Form_Open(Cancel As Integer)
If Me.RecordsetClone.RecordCount = 0 Then
Cancel = True
MsgBox "no body home."
End If
End Sub
 
Back
Top