G
Guest
I have a main form (one side) and a sub form (many side) which are linked and
operating correctly. Both forms contain amount fields. The sub form also
contains a category field. The total of the sub form amount fields must
equal the amount field of the main form for each main form record. I am
determining whether they equal by a calculated control (Difference) on the
main form. The sub form data needs to be manually updated by a user since
the required information varies and is not programmable (they break the
amount up by different categories, both of which vary).
When the user clicks save and close I have validation that checks to see if
1) all sub form records have a category and 2) the total of the sub form
amount fields equal the amount field of the main form for each main form
record.
My issue is that when the VBA program runs and the main form loops through
records to validate the category fields and amount/differences on the sub
form (from record 1 to record 2 etc) that the calculated control (Difference)
that indicates whether there is a difference or not has not refreshed yet.
Therefore, the program thinks there is a difference (validation error) on
every single record from the 2nd record on (on main form). I do have the
main form refreshing on the OnCurrent event (Me.Refresh). However, the VBA
program runs too fast for it. If I step through the VBA program in break
mode everything works great so I know my logic is correct (I can’t hit the
“step into†button as fast as VBA). It also works great on the user side
when entering data. As soon as they move from one record to the next or
update the amount the difference field updates properly and quickly.
Does anybody know any way around this.
Any help is greatly appreciated.
Thanks,
Bill Horton
operating correctly. Both forms contain amount fields. The sub form also
contains a category field. The total of the sub form amount fields must
equal the amount field of the main form for each main form record. I am
determining whether they equal by a calculated control (Difference) on the
main form. The sub form data needs to be manually updated by a user since
the required information varies and is not programmable (they break the
amount up by different categories, both of which vary).
When the user clicks save and close I have validation that checks to see if
1) all sub form records have a category and 2) the total of the sub form
amount fields equal the amount field of the main form for each main form
record.
My issue is that when the VBA program runs and the main form loops through
records to validate the category fields and amount/differences on the sub
form (from record 1 to record 2 etc) that the calculated control (Difference)
that indicates whether there is a difference or not has not refreshed yet.
Therefore, the program thinks there is a difference (validation error) on
every single record from the 2nd record on (on main form). I do have the
main form refreshing on the OnCurrent event (Me.Refresh). However, the VBA
program runs too fast for it. If I step through the VBA program in break
mode everything works great so I know my logic is correct (I can’t hit the
“step into†button as fast as VBA). It also works great on the user side
when entering data. As soon as they move from one record to the next or
update the amount the difference field updates properly and quickly.
Does anybody know any way around this.
Any help is greatly appreciated.
Thanks,
Bill Horton