thanks for your patience Michael,
i would like the [totaldirectdebit] feild to automatically display the
'answer' based on the [subtotal] *[paymentfrequncy], i want that answer to
update when/if payment frequency were to ever change.
So while completing a contributors detail form, it so far calculates the
contributors amount, the amount for his spouse, and the amounts for
dependants giving the answer in the subtotal feild, then [paymentfrequncy]
is
selected, either weekly monthy or fortnight etc, and its at this point i
would like the calculated answer automatically displayed in the
[totaldirectdebit]feild
si i guess an [eventprocedure] would be the most appropriate at this
time?,
say on got focus within the total directdebit feild?
Michel Walsh said:
Hi,
Since I am not aware of the full design, I can only assume you would
required the "sum" to be displayed in some control, but where, in which
form
event handling procedure? May be in the form open event, or may be in the
onCurrent event procedure handler.
-----------------------------
Private Sub Form_Current()
Dim mySum As Double
mySum= CurrentDb.OpenRecordset("SELECT SUM(pw.weight * tb.amount)
FROM
myTable As tb INNER JOIN paymentsWeights As pw ON
paymentFrequency =
pw.paymentFrequency").Fields(0).Value
Me.SomeControlToDisplayTheSum = mySum
End Sub
------------------------------------
but since this is a "constant", I hardly see any reason to recompute it
each
time a new record is to be displayed on the form, but again, that is the
easiest "event" that also allows some automatic "update". Maybe there is
a
better event that could get the code, but again, I am not aware of the
exact
design.
Hoping it may help,
Vanderghast, Access MVP