I have a form that is using query as the backend 'table'. I did this so that I could display query fields in my form that have been calculated.
1. How do I write those query field values to a table?
2. Is it possible to calculate what I am doing in the actual table field properties instead of trying to do it in a query and then write it to a table?
3. Is it possible to bound the calculation to a field in my table?
Thanks for your help!
Hi
In my experiance (which is still not complete!) the answers to your three questions are
1. Use VB code behind a button to construct an Update or Append query string (SQL) and execute this with either
CurrentDb.Execute SQL
or
DoCmd.RunSQL SQL
or
CurrentProject.Connection.Execute SQL
Whichever you are happiest with
2. Not as far as I know
3. Not as far as I know
But other may (do) know more than me!
Having said all that, normally it is considered bad practice to store calulated values if the calcs are based on static data (doesn't change), because you can calculate it again at any time. However, if, for instance, these are invoice values based on rates that will change in the future, then it is essential the value(s) are stored.
MTB