This is probably a simple question, but I looked through all the help screens and could not find a direct answer for this.
I have a query that I designed using Microsoft Query. It pulls data from Access. I have it saved as Query1.dqy
I would like for this query to be run whenever a certain button is clicked and certain criteria are met. So for the macro assigned to this button I have some if statements.
What is the VB I need to run the query inside the If statements? I can't find how you refer to and run an already saved query. All the info seems to be on defining a query and then saving/running it.
Example
Button_click()
If conditionA = true then
run Query1
Else
do something else
End if
Thanks in advance
Mark
I have a query that I designed using Microsoft Query. It pulls data from Access. I have it saved as Query1.dqy
I would like for this query to be run whenever a certain button is clicked and certain criteria are met. So for the macro assigned to this button I have some if statements.
What is the VB I need to run the query inside the If statements? I can't find how you refer to and run an already saved query. All the info seems to be on defining a query and then saving/running it.
Example
Button_click()
If conditionA = true then
run Query1
Else
do something else
End if
Thanks in advance
Mark