Updating a field in one table with data from another table

D

Dan Rolfe

I'm trying to run a procedure on the click event on a
form. What I need to do is open one table, start at the
top and store two field values, then update another table
with one of the values based on the second value in each
record. I've tried using a do while not EOF loop in the
first table to get the values, and then various
techniques (update method, SQL, etc)to update the value
of the field in the second table, then looping. I can't
get it right. I either get a syntax error, a compile
error, etc. I know it can be done, but I'm trying to
learn this stuff, and am not there yet. Any help would
be appreciated. Thanks, Dan
 
T

Ted

Hi Dan,

There are many ways that you could do what you want to
do. It sounds like you may be able to do everything that
you want by just passing parameters to update queries, or
by executing update queries that reference field control
values from your form. You could also loop through
recordsets using code.

It's hard to give much advice without knowing a little
detail. But I would recommend looking into update
queries. You can reference field values for your
criteria and for the new updated values. You can also
use iif() functions to specify conditional values.

Hope this helps.

-Ted
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top