record not save on form exit

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
 
R

Rick Brandt

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.
 
O

Ofer Cohen

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
 
Top