Unbound control - Can I check for null on before update?

G

Guest

I have a form with multiple unbound controls for entering new employees.
It updates to multiple tables. I've tried several ways to check for a blank
field before sending it to the table, and it's just not working.

Is it even possible to check for nulls in an unbound text box on the before
update?

Thanks,
J
 
A

Allen Browne

That's still not safe.

Although Exit fires even if nothing was typed, there is no guarantee the
user will ever click in that control, and if they don't, the Exit event
won't fire.

The simplest solution is to:
1. Open your table in design view.
2. Select the field.
3. In the lower pane, set its Required property to Yes.

If you want to give a warning but allow the user to override it, use the
BeforeUpdate event of the *form* (not control.) Access fires that event just
before writing the record to the table. Cancel the event if you are not
happy.
 
G

Guest

You're a genius. I didn't figure that would work because I knew they were
going to be unbound controls is why I didn't set that when I created the
tables.
Thank you.
 

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