From: Dennis on
John,

I got my answer - Call me.parent.Check_Batch_Balance.


--
Dennis


From: Dennis on
All,

Every one was correct in what they said. But there was still a timing issues.

Per John Winston, I modified my code check the batch balance each time I
updated a record. That worked, but then a timing problem popped up.

The batch balance amount is a figure calculated entirely by Access. That
may take a second or two to calculate. I put the call to the
Check_Batch_Balance procedure in the form's After_Update event.
Unfortunately, at the time the Check_Batch_Balance procedure ran, Access had
not updated the Batch Balance. So the I put a call into the On Entry event
of the first field on the row and Access still had not updated the total
after the current record had been updated and Access set focus to the first
field on the next row.

My solution was to remove the Check_Batch_Balance procedure, remove all
references to it and then change the Control Souce of the txtOutOfBalance
text box.

Originally, the Control Source of the txtOutOfBalance text box was “=Out of
Balance” and I relied on my VBA code to make the box visible and not visible.
After deleting all of my code for this purpose, I change the Control Source
to “=IIf([txtDif]=0,"","Out of Balance")”.

When I made this change, it worked perfectly. Granted, there was still the
timing issue, but Access automatically took care of that. When it finally
gets around to updating my batch balance (txtDif), it also updates the
txtOutOfBalance text box since it is dependent on txtDif. Note, when I say
finally I mean 1 to 3 seconds.

There is also a timing issue if there are a lot of checks in the batch. It
takes a second or two to load all of the checks in the continuous form and
calculates the batch total and the batch difference. This approach also
fixes that timing issue.


Dennis

First  |  Prev  | 
Pages: 1 2
Prev: Display data in a subform
Next: Bound Form Search