I have a way of doing this. In my case the user enters a total on the main
form they then have to allocate in a continuous sub-form. The main form has a
bound field called TotalAmnt. In the detail section of the sub form the user
enters the line amounts. In the formfooter I keep a running total of these
amounts with a field called lineTotal whose ControlSource is =sum(lineamnt).
Finally in the main form I have a field which keeps track of the amount left
to allocate whose control source is
=[TotalAmnt]-nz([Forms]![Add Expenses Record]![ExpenseLinSub]!LineTotal,0).
I don't let the user leave the form until the amount left to allocate field
is zero.
If this isn't what you want then you could try using the Ondirty event to
ensure all calculations had been done before the user can leave the form. As
in your case keeping running totals in this way isn't logically necessary -
but it was a requirement so I had to make it happen. Good Luck!
"BL" wrote:
> Hi, there,
>
> I believe a lot of you may come across this problem. A form was set up for
> user to enter a couple of fields for calculation. User enters every field
> correctly in first time. Press button to calculate the total which was used
> to update something else - say a total field in Main form.
>
> Then, user goes back and does the editing. However, instead of entering
> everything, or TAB over to finish entering the whole information, user just
> quits in the middle. As a result, some information has been changed and the
> total as calculated is not consistent anymore.
>
> We allow user to edit the record, of course, please give your advise how to
> prevent those data inconsistency. Is there any code that force the user to
> TAB over every field in a form or record.
>
> Thank you.
>
> BL
|