D
dan.rei1
Hi,
I'm rather new to using VBA, which I want to use in Access to get a
ribbon button to cause the "active query" (which is a parameterized
query that gets input from the user) to "re-run", so that it will ask
the user for new input. (With Access 2003 this was easy: I just put
the "run" button on a toolbar, and pressed it whenever it was needed.
With Access 2007 it wasn't quite as easy to get the button to appear
on a ribbon, but now that I have place the button there, I don't know
how to make it re-run the "active query.") (To re-run a query in
Access 2007 one must close the query output window, then find the
query among hundreds of queries, then double-click the query in order
to run it again; just "making it active" and "pressing the re-run
button" will be so much simpler!)
Here is the XML I have placed in table USysRibbons in order to create
the button, on a new ribbon Tab.
I'm hoping someone here might be able to give me a hand, or point me
to a reference, that will identify the VBA or other commands that
could let me know if the "active" screen is a query, and, if a query,
tell me the name of the query, so that I could use the DoCmd.OpenQuery
to re-run the query. (Or, if this is a bad approach, steer me toward
a better approach.)
Thanks in advance.
I'm rather new to using VBA, which I want to use in Access to get a
ribbon button to cause the "active query" (which is a parameterized
query that gets input from the user) to "re-run", so that it will ask
the user for new input. (With Access 2003 this was easy: I just put
the "run" button on a toolbar, and pressed it whenever it was needed.
With Access 2007 it wasn't quite as easy to get the button to appear
on a ribbon, but now that I have place the button there, I don't know
how to make it re-run the "active query.") (To re-run a query in
Access 2007 one must close the query output window, then find the
query among hundreds of queries, then double-click the query in order
to run it again; just "making it active" and "pressing the re-run
button" will be so much simpler!)
Here is the XML I have placed in table USysRibbons in order to create
the button, on a new ribbon Tab.
I'm hoping someone here might be able to give me a hand, or point me
to a reference, that will identify the VBA or other commands that
could let me know if the "active" screen is a query, and, if a query,
tell me the name of the query, so that I could use the DoCmd.OpenQuery
to re-run the query. (Or, if this is a bad approach, steer me toward
a better approach.)
Thanks in advance.