do not save blank form

  • Thread starter Thread starter Guest
  • Start date Start date
Do you really mean an empty form, or do you mean how to prevent a row with
no data from being saved to the table?

For the latter, you can put code in the form's BeforeInsert event to ensure
that there's data, or set Cancel = True if not.
 
frustrated said:
What's the best method to prevent an empty form from being saved to the
database?


What do you mean by "empty form"?

A form is saved when you design it and tell Access to
close/save the form's design. Empty does not have any
meaning in this context.

If you mean saving a new record without having entered any
data into a bound control, Access doesn't do that.
Therefore, I would expect that you must have a macro or some
VBA code somewhere behind the form (Current event
procedure??) that is setting at least one field's or bound
control's value.
 
Thank you.

Douglas J. Steele said:
Do you really mean an empty form, or do you mean how to prevent a row with
no data from being saved to the table?

For the latter, you can put code in the form's BeforeInsert event to ensure
that there's data, or set Cancel = True if not.
 
Thank you. You're right.

Marshall Barton said:
What do you mean by "empty form"?

A form is saved when you design it and tell Access to
close/save the form's design. Empty does not have any
meaning in this context.

If you mean saving a new record without having entered any
data into a bound control, Access doesn't do that.
Therefore, I would expect that you must have a macro or some
VBA code somewhere behind the form (Current event
procedure??) that is setting at least one field's or bound
control's value.
 
Back
Top