By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,478 Members | 1,833 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,478 IT Pros & Developers. It's quick & easy.

Check Subform record before saving record.

P: n/a
Hi,

I have a a bound subform and what i'm trying to do is do check if some
criteria applies before saving the record and trigger a macro.

basically this is what I got.

Date Received InStock UnitPrice
When I Create a new record I need to check that all these fields are
not empty if they are empty then stay on the record but not save it.
otherwise save and run macro.

if the record exits and the user modify the UnitPrice...afte update of
the UnitPrice Save and run macro

I tried everything ..after update , after insert but I dont get what I
need. may be I need a unbound subform?

thanks!

Dec 20 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
To validate forms, the best event to use is the form's Before_update event.
If something fails the test, you can then set Cancel =true and the record
will not be updated, and the user will "stay on the record but not save it"
as you describe. You will of course want to give them some kind of message
telling them what went wrong and how to prevent it. You can either do the
validation yourself in the before_update event, or you could also just set
these fields to "required" in the table, or put validation rules in the
controls that say "is not null". If you do the former, you get klunky
Access warning messages. If you do the latter you can put in your own
validation text.
-John

"Cesar Zapata" <ce**********@gmail.comwrote in message
news:11**********************@48g2000cwx.googlegro ups.com...
Hi,

I have a a bound subform and what i'm trying to do is do check if some
criteria applies before saving the record and trigger a macro.

basically this is what I got.

Date Received InStock UnitPrice
When I Create a new record I need to check that all these fields are
not empty if they are empty then stay on the record but not save it.
otherwise save and run macro.

if the record exits and the user modify the UnitPrice...afte update of
the UnitPrice Save and run macro

I tried everything ..after update , after insert but I dont get what I
need. may be I need a unbound subform?

thanks!

Dec 20 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.