Validating Subform Entries

G

Guest

I'm using Access 2k. I've got a form for entering invoices, each invoice can
have multiple lines and these are displayed with a linked subform. I need a
way to validate that the sum of the entered invoice lines in the subform
equals the invoice total on the parent form. I can't use the Main Form's
BeforeUpdate event since this event fires on entry into the subform (when
there may be no related lines entered yet). I attempted to cancel the exit
from the subform but since the record isn't inserted yet I can't check the
sum till that routine fails once. Any thoughts on how to do this or where to
hang some code to do this?
 
A

Allen Browne

The main form should NOT store the total of the invoice at all.
Just display the total from the subform.

For an example of how to do that, open the Northwind sample database, and
open the Orders form in design view.
 

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