Help in updateing multiple tables

hawg1

Registered User.
Local time
Yesterday, 20:35
Joined
Sep 24, 2006
Messages
51
HI,

I have 10 tables in a DB and one form (based on table 1) so far. I need to take the SSN field info from the form and place it into the other 9 tables. I have created 9 append queries (to update each form individually).

I would like to execute all nine queries, via an on click event, using the forms Save cmd button. I'm pretty sure that a For next loop is the way to go, just not sure how to code it so the Docmd.OpenQuery statement can run each query.

Any information/suggestions is gladly aprreciated,

thanks
 
You should store the SSN in one table only. What you're asking can be done but i think you should redesign your database to the BCNF.

HTH
 
If you name the queries numerically (AppendQuery1, AppendQuery2.....) then use a String for the query name and update the string as the For loop runs. Something like this

Code:
    Dim queryName As String
    queryName = "AppendQuery"
    Dim num As Integer
    num = 1
    For num = 1 To 9 Step 1
        DoCmd.OpenQuery queryName & num 
    Next num

Hope this helps.
 
Karl05,

Thanks for the info. That is exactly what I needed.
 

Users who are viewing this thread

Back
Top Bottom