How can I run multi action queries in one execution?

G

Guest

I would like to create a excution command to run update queries, make table ...in one run, similar to command button but ONLY one button. Thanks. e.g. a button create in a For

UPDATE [Make tbl Daily Neg adj and tran SUM] INNER JOIN [Balance Sheet Current] ON ([Make tbl Daily Neg adj and tran SUM].LOC = [Balance Sheet Current].SITE) AND ([Make tbl Daily Neg adj and tran SUM].PART_NUMBER = [Balance Sheet Current].[PART#]) SET [Balance Sheet Current].[Adj (-)] = [SumOfQUANTITY
WHERE ((([Make tbl Daily Neg adj and tran SUM].CODE) Like "*70*"))


UPDATE [Make tbl Daily Neg adj and tran SUM] INNER JOIN [Balance Sheet Current] ON ([Make tbl Daily Neg adj and tran SUM].LOC = [Balance Sheet Current].SITE) AND ([Make tbl Daily Neg adj and tran SUM].PART_NUMBER = [Balance Sheet Current].[PART#]) SET [Balance Sheet Current].[Adj (+)] = [SumOfQUANTITY
WHERE ((([Make tbl Daily Neg adj and tran SUM].CODE) Like "*30*"))
 
T

Tony Toews

BestbuyFS said:
I would like to create a excution command to run update queries, make table ...in one run, similar to command button but ONLY one button. Thanks. e.g. a button create in a Form

You can call multiple queries from within VBA.

I prefer, if DAO, to use Currentdb.Execute strSQL,dbfailonerror
command instead of docmd.runsql. For ADO use
CurrentProject.Connection.Execute strCommand, lngRecordsAffected,
adCmdText

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
 
G

Guest

Use the Macros tab in the database window to create a macro that runs the queries
Put a command button on the form and have the command button run that macro

<-*-><-*-><-*-><-*-><-*-><-*-><-*-><-*-
Hope this helps
Anne Tro
Author: Dreamboat on Wor
Email: Dreamboat*at*Piersontech.co
Web: www.TheOfficeExperts.com
 

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