I have a form that is bounded to a table, and is set to allow addition only.
When the form is open, and when user had typed data in certain fields, the record will be inserted into the table upon closing of the form.
The problem is this (example): 3 fields. All are needed to have data. User typed data in 2 of the fields and left one field blank. Upon closing of the form, it tries to insert the data into the table (but failed of course)...but this causes an error and produce a message box.
Is there any way that I can write some VBA to check the fields upon closing...and abort/skip the insertion by VBA?
When the form is open, and when user had typed data in certain fields, the record will be inserted into the table upon closing of the form.
The problem is this (example): 3 fields. All are needed to have data. User typed data in 2 of the fields and left one field blank. Upon closing of the form, it tries to insert the data into the table (but failed of course)...but this causes an error and produce a message box.
Is there any way that I can write some VBA to check the fields upon closing...and abort/skip the insertion by VBA?