G
Guest
Hi
Why is everyone hiding for this issue??...saying not recommended, redundant
data, etc. but no one tells me it is impossible to do...and I very much need
to do it...and I think I can have it under control.
Se more below.
Best wishes
Mattias
Why do you want to save a calculated field?
If you insist on doing so (not recommended to store redundant data) why are
you not using an update query?
Rick B
Hi Rick
This form is like a order or invoice with a unique invoicno. When the
invoices are created they have a null value in the fields Total2 and
TotaltInbetalt2 (=paid up to now) in the table.
This is because there is a lot of manual hands on and unique handling of
each invoice. One invoice can have 50 part payments, ex: 2 can be cash, one
partpayment can be credit card with adding a % fee to the total2, next can be
a partpayment in another currency adding adding a % fee (for the excange) to
the total2.
Once in a while I need to run throw all the records update the fields with
current values, and after that I want to run an updatequery to update the
invoicetable to the correct paymentstatus.
And since I cannot referense a Form object in an update query I need to
store the values to the table.
Mattias
Why is everyone hiding for this issue??...saying not recommended, redundant
data, etc. but no one tells me it is impossible to do...and I very much need
to do it...and I think I can have it under control.
Se more below.
Best wishes
Mattias
Mattias said:I have a form with ontimer event where starts on the first record when it
open, then via a gotonextrecord func to the last record in the recordset.
For every record I want to save the calculated value from Total and
TotaltInbetalt to the bound controls Total2 and TotaltInbetalt2.
Tried the on current below but did not autosave when from one record to
another!
Private Sub Form_Current()
Me!Total2 = Nz(Me!Total)
Me!TotaltInbetalt2 = Nz(Me!TotaltInbetalt)
'DoCmd.RunCommand acCmdSaveRecord
End Sub
Thank you in advance
Mattias
Why do you want to save a calculated field?
If you insist on doing so (not recommended to store redundant data) why are
you not using an update query?
Rick B
Hi Rick
This form is like a order or invoice with a unique invoicno. When the
invoices are created they have a null value in the fields Total2 and
TotaltInbetalt2 (=paid up to now) in the table.
This is because there is a lot of manual hands on and unique handling of
each invoice. One invoice can have 50 part payments, ex: 2 can be cash, one
partpayment can be credit card with adding a % fee to the total2, next can be
a partpayment in another currency adding adding a % fee (for the excange) to
the total2.
Once in a while I need to run throw all the records update the fields with
current values, and after that I want to run an updatequery to update the
invoicetable to the correct paymentstatus.
And since I cannot referense a Form object in an update query I need to
store the values to the table.
Mattias