01-12-10, 19:47 #1Registered User
- Join Date
- Jan 2010
Unanswered: Adding a calculated text box value to a table field on a form
Please could somebody advise me on how to add a calculated text box value to a field within a table. Basicly i have a form that records bookings and a text box thats sums the cost of each booking together giving me a sub total, which updates each time an extra booking row is added. I now want that value to be added to a field in my Invoice table.
I am not sure on how to do this. Any help much appriciated
01-13-10, 08:30 #2Registered User
- Join Date
- Aug 2009
- Up Nort' Wi
I'm not sure why you'd want to physically save a derived value (it's usually left for form controls and reports to do the calculating off hard values stored), but, I'd imagine something like that could be done by adding a TotalBooking feild to the table and when you add a record to the table:
1)Have it look at the last previous record (Rec1) and get its TotalBooking value
2)Then add the your record's (Rec2) CurrentBooking to Rec2's TotalBooking and store it in your record's TotalBooking field.
So basically it'd look something like: Rec2.TotalBooking = Rec1.TotalBooking + Rec2.CurrentBooking
Sam, hthGood, fast, cheap...Pick 2.