From: g on


When a button is clicked on a Access Form, I want to run a query and
display its result. I am able to do that, but my form has 12 buttons and
I am creating 12 different query objects(containing the 12 queries) for
them. So, the left had side of my window(which displays all Access
objects) which shows 12 query objects.

Now, I have to create another form which has 6 buttons which on clicked
will run 6 different queries.

1. Is there a way in Access 2007 where instead of creating another 6
query objects I can create a single query object which can contain the 6
different queries and run query 1 when button 1 is clicked, run query 2
when button 2 is clicked and so on.

2. If there is no such way, can I alleviate the issue of having multiple
query objects by running a macro when the button is clicked which runs a
query based on which button is clicked and produces the results. How
difficult would this be to do? Currently, all I have to do is create a
query object and add some SQL to it so that it produces the desired result.

Any suggestions would be appreciated.