D
DowningDevelopments
I have a form where im trying to calculate the difference between the moneies
collected and those owed.
The collected amount is worked out by summing up a subform which holds all
the payments made by a person. There is a SUM field in that subform that is
referenced by the mainfrom to display this data to the user.
I Have a requery button which is pressed to update the subform and give the
new total. This is the sub for the update button.
<!---
Forms!Receipts![PaymentListSubform].Requery
If Me![TotalCollected] < Me![TotalCharges] Then
'difference = charges - collect
Me![Difference] = Me![TotalCharges] - Me![TotalCollected]
Else
'difference = collect - charges
Me![Difference] = Me![TotalCollected] - Me![TotalCharges]
End If
--!>
So why is it that im getting the value of Total charges in the difference
box? ive used a watch and its telling me that its not giving any value for
the TotalCollected. I suspect that this has to do with the requery, which
does update this total, but ive tried to put this extract of code into other
subs and im finding it hard to figure out where to put it so that it updates
to show the changing total.
With Much thanks
Amit
collected and those owed.
The collected amount is worked out by summing up a subform which holds all
the payments made by a person. There is a SUM field in that subform that is
referenced by the mainfrom to display this data to the user.
I Have a requery button which is pressed to update the subform and give the
new total. This is the sub for the update button.
<!---
Forms!Receipts![PaymentListSubform].Requery
If Me![TotalCollected] < Me![TotalCharges] Then
'difference = charges - collect
Me![Difference] = Me![TotalCharges] - Me![TotalCollected]
Else
'difference = collect - charges
Me![Difference] = Me![TotalCollected] - Me![TotalCharges]
End If
--!>
So why is it that im getting the value of Total charges in the difference
box? ive used a watch and its telling me that its not giving any value for
the TotalCollected. I suspect that this has to do with the requery, which
does update this total, but ive tried to put this extract of code into other
subs and im finding it hard to figure out where to put it so that it updates
to show the changing total.
With Much thanks
Amit