record not save on form exit

  • Thread starter Thread starter ll
  • Start date Start date
L

ll

Hi,
I was wondering if there is a way to not save the record upon exit of
an incomplete form? I am winding up with empty columns and desire
just completed ones.

Thanks,
Louis
 
ll said:
Hi,
I was wondering if there is a way to not save the record upon exit of
an incomplete form? I am winding up with empty columns and desire
just completed ones.

Thanks,
Louis

In your table set those field's Required property to Yes. Then the form will
only save completed records.
 
You can use the Form BeforeUpdate event to check if the fields are filled, if
not prompt a message and stop the save

Something like

If IsNull(Me.[TextBoxName]) Then
Msgbox "Fields must be filled"
Cancel = True ' will stop the save
End If

For more then one text box:

If IsNull(Me.[TextBox1Name]) Or IsNull(Me.[TextBox2Name]) Then
Msgbox "Fields must be filled"
Cancel = True ' will stop the save
End If
 

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