!!Addition in Unbound text box causes lock up

bojbrown

Registered User.
Local time
Today, 08:01
Joined
Mar 24, 2004
Messages
18
I have come across a problem that is causing Access 2000 to lock up!

I have a form that displays invoices for a customer in a subform. Each record/row in the subform displays the invoice #, date, total due, total paid and total write-off. This works without a problem and displays all invoices for a customer. The user can even double-click on the invoice # field to display another form that displays all of the detail transactions of that invoice.

When I changed the subform to add an unbound text box that calculates the remaining balance due for each invoice, Access locks up.

The names of the three fields are INVC_AMTDUE, INVC_AMTPAID, and INVC_AMTWO. In the unbound field (named BalDue), in the Data Control Source, I have =[INVC_AMTDUE] - [INVC_AMTPAID] - [INVC_AMTWO]. The form displays correctly and calculates correctly, but when you click on the exit button to close the parent form, the message "You can't carry out this action at the present time" is displayed, and everything in Access locks up. I can't even select the File...Exit menu command. Double-clicking on the invoice # field causes an error. I have to use Task Manager to kill the app.

Does anybody have any clue why this happens? Is there another way to display this 'Balance Due' calculation?

I would appreciate any information or help regarding this issue.
Thank you.
 
Try put the calc in code instead like this:
Me.BalDue =Me.[INVC_AMTDUE] - Me.[INVC_AMTPAID] - Me.[INVC_AMTWO]
 
I have tried that, but each record displays the total of the first.

For example, if the customer has 2 invoices, and the amounts are:
Due Paid WO Bal Due
100 0 0 100
200 0 0 100

the results of the first record/row are displayed in every row. I've tried putting the calculation in the Current event, On active event, and others, but there doesn't seem to be a way to have the form load and each row calculate correctly. The only way was to put the calculation in the
Data Control Source field.

If I've missed something, please advise.
Thank you.
 

Users who are viewing this thread

Back
Top Bottom