How to run various queries

  • Thread starter Thread starter Anton
  • Start date Start date
A

Anton

Hii Guys ,

I am building a database and need to run 6 queries before i can print a
specific report . I would like to do this with a macro if possible but i am
very new to this area is there an easy why like the one in excel to record a
macro if not , from where should i start ?

Anton
 
Anton,

Macros in Access are quite different creatures from macros in Excel.

I assume you already have your queries created? I assume they are
Action Queries (Append, or Update, or Make-Table, or Delete)?

Make a new macro in design view. Select OpenQuery from the drop-down
list of Actions, and then enter the name of your first query in the
Arguments section at the bottom. Repeat this procedure for each of the
other queries. Close and save the macro. Then you can enter the name
of the macro in a suitable event property. For example, in design view
of a form, you might have a Command Button, and you assign the macro on
the On Click event property of the button, in which case the macro will
run the queries when you click the button in form view of the form.

After you have it working correctly, you might want to put a
SetWarnings/No action in the macro, ahead of the first OpenQuery, to
suppress the display of the action query confirmation messages.
 
Hiii Steve
you got me SMILING again :)

Thank you i will try it out , yes i do have the queries ready . Why do u
recommand that i do the no action before ?

Thank you again

Anton
Access For Fun
 
Anton,

Just using the OpenQuery actions, for each query you will get a
confirmation message, for example "You are about to update 123 records,
ok?" or whatever. That is good to see when you are setting it up and
testing, but when you put the database in production you may not want
the user to have to click through these. Using a SetWarnings action in
the beginning of the macro will supopress these messages.
 
Back
Top