Event Name

  • Thread starter Thread starter DBarker
  • Start date Start date
D

DBarker

I have created an If statement that I want to put in
several areas of the form to check figures before going
to the next record or exiting. I tried to put it in
before update but even if the amounts are wrong it is
allowing the user to click the record indicator and going
to the next record. Any help would be appreciated.

Thanks,
Debbie
 
I think that BeforeUpdate is the correct event to use.
You should not forget to set Cancel = True in case the amounts are wrong.

Pavel
 
Actually when I use the beforeupdate on the main form it
then will not move to the subform on the form and I get
an error message.

Debbie
 
Ok, this is what I anticipated. You didn't say you had a subform before.
Validity chacking should be done on the form that contains the data to
be validated, if you want to be able to cancel the table update. You
can, indeed, trace the changes and undo them using Transactions, or
simply using SQL from the Main form.
But for your specific case it would be nice to know the design - what
are the form and subform, how they are linked and which validity checks
are run and when.

Pavel
 
OK, I have the main form and in the header of that form
they enter the total amount of the invoice. after
entering that data they move to the subform where they
enter the different accounts and amounts that invoice gets
split between. Before moving to the next record I want to
confirm that the total amount of the invoice equals the
sum of the multiple amounts they entered in the subform.

The subform is tied to the main form by the id on the main
form.

Thanks,
Debbie
 
Back
Top