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]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top