Input Validation

GregD

Registered User.
Local time
Yesterday, 20:58
Joined
Oct 12, 2007
Messages
47
I fell back on my VB programming once again, but I’m sure there is an easier way to handle this in Access.

So here is the deal. I have a table with 15 or so fields in it. I need the user to on occasion add another row to the table. Nine of the fields are required but the rest can be left blank. It needs to be an all or nothing sort of thing. Either they populate the 9 fields or no new row can be added.

What I ended up doing was using the AutoForm button to create a form and then broke the bounds on the form. I then added a Save button and an If…Then block to make sure the 9 text boxes had data before I save the record.

Is there an easier way to validate only 9 of the 15 text boxes on the form before the records is saved.
 
Is there an easier way to validate only 9 of the 15 text boxes on the form before the records is saved.
The EASIEST is to go into the table and change the Required NO to Required YES.
 
The EASIEST is to go into the table and change the Required NO to Required YES.

I found that after I made the form. I guess I could test this, but how does it work. If the user only fills in 4 of the fields does it not save anything. I always thought the bound controls saved data as soon as it lost focus.
 
I found that after I made the form. I guess I could test this, but how does it work. If the user only fills in 4 of the fields does it not save anything. I always thought the bound controls saved data as soon as it lost focus.
A form will not save data until it moves to another record or the form is closed. If you move off of a control it isn't saved yet.
 
Oooooh, I thought each field was updated as you moved off it. Thanks.
 

Users who are viewing this thread

Back
Top Bottom