Which event do I choose when checking form against subform?

M

Mercy

Hey people :)

This is a pretty basic question.

I have a FORM, which contains a SUBFORM. I want to be
able to check the data in the FORM against the data in
the SUBFORM. And if they don't match ... BEEP , MSGBOX ,
and force the user to enter the correct quantities by
CancelEvent. This is just so I can do a data validation
thingie.

The question is: Which event do I put this code in? And
what's the best DoCmd?

At first I put the code in the "AfterUpdate" event for
the Form... but that was throwing an error before I even
had a chance to put data into the SUBFORM.

Right now I have the code in the "exit_subform" event.
But that forces me to return to the subform when the data
don't match. And that doesn't cover the case when the
error in data is in the Main form not the subform.

I am choosing the wrong event? Or am I choose the wrong
DoCmd? Maybe there's another more suitable DoCmd other
than "CancelEvent"?

Any help would be greatly appreciated! Thanks!

Mercy
 
M

Mercy

I am creating an order form for a clothing manufacturer.

So in the Main form I have a Qty of total articles that
they are buying.

The Subform contains the breakdown of their order.

ie: 15 Red shirts
500 Pink shorts

My boss wanted to have a this rudundancy of qtys to make
sure that the data entry is correct.

.... But everyone on this newsgroup tells me that this
redundancy is stupid.... :p What do you think?


-Mercy
 

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