View Full Version : Need help on Subforms


MICHELE
08-01-2001, 01:30 PM
I have a form with 2 subforms. I have my subforms totalling on the main form. Now, each time a job is pulled up, I need to make sure the amount on the main form, CONAMT, is equal to the total of the subform. If it isn't equal I need some kind of message to come up on the screen. I'm not sure where to start.
Also, how could I write a query to find all jobs in the main table that don't equal the total of each job in the sub table?

Jack Cowley
08-01-2001, 03:32 PM
If you have two field on your Main form (Main Total and Subform Total) then in the On Current event of the Main form code like this should do what you want:

If Me.MainTotal <> Me.SubformTotal Then
MsgBox "Totals are not the same."
End if

For the queries I would create one to get the totals for the jobs in the sub table. Then use the Query Wizard to find unmatched records....

Pat Hartman
08-01-2001, 06:39 PM
This is just another example of why storing summary information is problematic.