checkbox validation

  • Thread starter Theresa D via AccessMonster.com
  • Start date
T

Theresa D via AccessMonster.com

I have an Access 2002 db that I created for a medical research study.
The first pass of data entry is almost finished. I am working on the
validation for the second pass of data entry. I'm having problems validating
the checkboxes. I have some code in the AfterUpdate event for each checkbox.
It works fine if the box is checked in the second pass, but it wasn't checked
in the first pass. If I tab past a checkbox (leaving it unchecked) that was
checked in the first pass, then nothing happens. I was thinking of getting
around this by just validating all of the checkboxes at once (when the record
is saved, or another form is opened). Does anyone have any suggestions or
problems with this approach?

TIA,
Theresa
 
B

Brendan Reynolds

The Before Update and After Update events of any control are fired only when
the value of the control is changed. The events are not fired if there is no
change. The Exit (and Lost Focus) event will fire when the user moves from
one control to another, regardless of whether the value changed, but the
user must move to the control first - the Exit event will never fire if the
control never receives the focus in the first place, e.g. if a user moves
from control 'A' to control 'C' by clicking with the mouse, by-passing
control 'B', then the Exit (and LostFocus) events of control 'B' will not
fire. Therefore, while these events have their uses (to give immediate
feedback to the user as soon as invalid data is entered) you will often need
to perform additional validation in the Before Update event of the form.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top