Problem with Calculated Subform data transferring to Table

Dylan

Registered User.
Local time
Today, 21:32
Joined
Sep 4, 2003
Messages
23
G'day,
I'm hoping that someone can help me please. In the attached database I calculate Costs for campsites based on days spent at site and the number of Adults, Children etc on the booking form. Although the results are correct on the subform I don't seem to be able to get the values for "Days" and "Cost" to be transferred the "Bookings" table. They are either missing ('Days') or do not reflect the current values ('Cost') on the subform.
In the case of "Days" I calculate the datediff between Arrival and Departure dates ok in the subform but cannot get result into the underlying table.
Any help or suggestions would be greatly appreciated.
 

Attachments

Dylan said:
In the case of "Days" I calculate the datediff between Arrival and Departure dates ok in the subform but cannot get result into the underlying table.

Simple concept problem: you DON'T need it in the table. It's a calculable value emaning that you can calculate it any time you need it - on a form, report, or query. Why store it in a table if you have the elements to calculate it anytime?
 
why do you want to store the values in the table ? ... it is not ideal to store calculated values in a table!
 
Mile-O and Max,

Thanks guys for the prompt response.

I sort of knew what the answer was going to be, but wondered if it was possible?

Thanks again.
 
Dylan said:
Mile-O and Max,

Thanks guys for the prompt response.

I sort of knew what the answer was going to be, but wondered if it was possible?

Thanks again.

It is easy to do it with a simple SetValue action into a field you have to store the value. But as the others have said it is not generally a good idea to store calculated values and one reason being that the stored data can be out of date.

What you can do is to have the calculation done in a query field and that way it virtually behaves as if it was stored in a table.

Mike
 
i've read somewhere that it can be done by using the SetValue in Macros, but i've never tried it myself.
 
There you go again :rolleyes: you don't have to have the calculation done in a query. In fact in pure theoretical terms it's the worst place to put it.
Oh, and do some reading here on why not to use Macros.
 

Users who are viewing this thread

Back
Top Bottom