John,
Thanks for your response ...
I made a mistake by using the .db for the tables; they were originally
called that before they were imported to Access ... SORRY.
I am using one table to update the information in the other table.
The Reserve table is only a 'temporary' holding area of the update data
information.
Are you "updating" - changing values of fields in existing records -
or "inserting" - adding new records to the target table? These are
different queries, an Update query and an Insert query respectively.
I understand how to put a command button on a form, but have never
activated a update query from a command button.
The button wizard will offer that as an option; or (probably better in
this instance) you can use VBA code to open and execute a Querydef
object.
I am using query as a source for part of the data present on the Reserve
form that gathers some of the update information.
The rest of the update information is entered by the user in textboxes.
Are you intending to update the target table, one record at a time? or
in bulk?
I have not used an 'update query' before.
It's right in the online help. It is best suited for updating multiple
records at a time, but for that reason may not be appropriate here.
The math that I am referring to will be something like taking a taking a
percentage of one number and adding or replacing the values in an
existing field of the detail table if the value in the detail falls
within a specified range.
You're aware, I presume, that it's generally considered A Bad Idea to
store such derived data in any table? Sometimes (and this looks like
it may be one) you need to do so, but it's always sort of a last
resort!
Are there wizards to help me?
Yes. The command button wizard has an option to run a query, for
instance.
Example code of such things as changing a field in one table based on
values from another table via an update query might get me started.
Thanks very much for your efforts!
No code is needed: just a Query. If you have TableA joined to TableB
by a field with a unique index in TableA (such as the Primary Key),
you can usually create a Query joining the two tables; change it to an
Update query using the query type icon; and put
[TableB].[fieldX]
on the Update To line under TableA.FieldY in order to update FieldY
with the corresponding value in FieldX.