run multible querys with one

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a database that has 7 update querys that all update to the same table.
is there a way to string them together with one???
 
I have a database that has 7 update querys that all update to the same table.
is there a way to string them together with one???

Either create a Macro with seven RunQuery steps, or (better) write a little
VBA routine (perhaps the Click event of a command button); the code could use
the Querydef Execute method to execute the seven queries. See the online help
for Execute.

John W. Vinson [MVP]
 
John W. Vinson said:
Either create a Macro with seven RunQuery steps, or (better) write a
little
VBA routine (perhaps the Click event of a command button); the code could
use
the Querydef Execute method to execute the seven queries. See the online
help
for Execute.

Depending on the nature of the updates, you might also want to use a
transaction if for example, you want to undo all of the 7 queries if one of
them fails.

Check the BeginTrans, CommitTrans and Rollback methods in the online help.
 
henrysouth said:
I have a database that has 7 update querys that all update to the same table.
is there a way to string them together with one???

henrysouth,

I recommend Visual Basic for Applications, VBA. Also known in MS
Access as "Modules".

Example:

Public Sub RunYourActionQueries()

Dim db As DAO.Database

Set db = CurrentDb()

db.Execute ("<your action query number one>")

db.Execute ("<your action query number one>")

Set db = Nothing

End Sub


Note: "<your action query number one>", etc., in the example above
have spaces in them for descriptive purposes only. The name of your
query is supposed to be entered between the quote marks, and query
names should not have spaces.


Sincerely,

Chris O.
 
db.Execute ("<your action query number one>")

db.Execute ("<your action query number one>")

That second line should have been:


db.Execute ("<your action query number two>")


Sincerely,

Chris O.
 
dears,
here is the table and report requirement any one please help as im going to
face the exam on 10/02/08 13.00 hrs please .b'cse its my employment .
here is the table Employeename . text
employeeid . number
fromdate . date/ time format (dd/mm/yy),
todate . date/time format(dd/mm/yy)
duty lookup >( absent or present)
REPORT: Required in the manner is say for eg,in excel format
month in one column(a3) as jan,feb,march,april,..til december
date in top row(b2) that is 31 days like 01,02,03,04,...31
employee present or absent is required for individual day
for the perticular month and date right below the perticular day & aginest
month
i beg all my community friends to do best for me please
thanking you.
 
Back
Top