Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

specifing query name in macro

Status
Not open for further replies.

wheels27

MIS
Aug 26, 2002
30
US
i am writting a macro that will use multiple update queries
i know in the sql it specifies the name of the table, how do you set it to run and prompt you for the name of the table you want to update

when i run the multiple queries using the macro

nick
 
If I've understood correctly, you want to run an update query on several tables. For this to work, all of your tables would have to have identical field names - which seems unlikely.

Anyway, if you do want to do this, the following method may suit:

+ declare a variable
+ use something like an inputbox to prompt the user for the table name and assign the value entered to the variable
+ construct your SQL using the variable

dim sInput as string

mySQL=&quot;update table &quot; & sInput & &quot; set [FIELDNAME].&quot; & sInput & &quot;=<VALUE>&quot;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top