Empty Record

  • Thread starter Thread starter Karen
  • Start date Start date
K

Karen

How can I set up a restriction on a form so the user will
not be able to close the form if there is an empty record?

Thank you, Karen
 
How can I set up a restriction on a form so the user will
not be able to close the form if there is an empty record?

Thank you, Karen

Make at least one field in the form's underlying Table Required.

Or, use the Form's BeforeUpdate event to check that some field is
filled in:

Private Sub Form_BeforeUpdate(Cancel as Integer)
If Me!txtThis & Me!txtThat & Me!txtTheOther & Me!txtWho _
& Me!txtWhat & Me!txtIDontKnow = "" Then
Cancel = True
MsgBox "Please enter something on the form", vbOKOnly
End If
End Sub

using the names of the controls on your form.

John W. Vinson[MVP]
 
Back
Top