View Full Version : Form update question


jnh11
05-30-2000, 06:16 PM
New at this game...
Would like to control when a data on a forms
is added to database (option control) to
insure that all fields are keyed before record is actually created.

Also same questions applies to sub forms.

Sample: Form has Client data. Don't want to
create DB record until all fields
have been entered.
Sub Form has order data. Don't want
to create table record until all
fields have been entered

Thanks for any help or samples you can offer.

jnh11

Pat Hartman
05-31-2000, 09:53 AM
You have several choices. Two of them are:
1. Open the table in design view and mark all the required fields as required. Access will then not allow the record to be saved if any required field is empty.

2. In the BeforeUpdate event of the form, add your own code to check for the presence and validity of all required fields. If any errors are found, display a message using the MsgBox and cancel the update event by adding the following line of code at the appropriate point:
Cancel = True