Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Comparing fields on forms and sub forms

Status
Not open for further replies.

Eurof

IS-IT--Management
Nov 14, 2003
9
DE
I am not sure if this is easy or difficult. Anyway here goes.

I have a form with a subform. Within the subform I have a footer which totals up a quantity field. This total is not visible since the sub form is a datasheet. However, on the main form I have a text box which references the total on the footer.

What I am trying to do, is when I enter a record on the subform that the system totals the quantity, shows this on the main form and do some checks. However, I cannot find the correct event to do this in. As it seems that if I use the AfterUpdate on the subform, it is too early and it working on the previous total value.

Are you still with me. Is there an event after the footer is processed.
 
Hallo,

Have you tried the OnCurrent event on the main form?
The subform processing is performed before the main form processing, but I can't say for definate that it will have finished without trying it out.

- Frink
 
Thanks for that, but it still does not work, so it must not be the correct event.
 
Don't use the AfterUpdate on the subform, use the AfterUpdate on the control on the subform. You realize that from there you will have to populate the control on your main form, which means you must reference the mainform and the control from your subform.
 
The problem has moved on slightly, but the original fault is still there. My subform is as data sheet and for some reason all the events I choose to use are all before the footer fields are updated??
 
That is why youi need to get the event from the control in the footer that is doing the calculation. From there you can use the AfterUpdate and send it to the main form.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top