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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

combining queries

Status
Not open for further replies.

gr8whitewaldron

Technical User
Aug 6, 2003
25
US
I have a form that uses a number of update queries to determine a value. How would I put all the update statements into one query?
 
You can only update one table at a time, but you can update multiple fields within the same record.
e.g. UPDATE MyTable SET Field1 = 1, Field2 = 2 WHERE Field1 = 0

See the help (Access & SQL BOL) for further information.
 
You can send multiple sql statements in a batch by delimiting with semi colon.

Dim mysql as string
dim cn as new adodb.connection

mysql = "select * from tab1; select * from tab2"

cn.execute mysql
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top