Need help with macro

G

Guest

Posted before but don't think i explained it well. I have a database with a
main switchboard. From the switchboard you can do various queries which are
linked to by command buttons. When you click the command button it closes the
switchboard and shows a dialogue box which asks for the criteria set up in
the query. If I click cancel at this point, the screen closes and I am left
with just the database window. I want the switchboard to open if I click the
cancel button. I know I have done it before but can't remember how.......!!!
 
J

Jeff Boyce

If you want the switchboard available "behind" the query, don't close it.

--
Regards

Jeff Boyce
<Office/Access MVP>

Scooby said:
Posted before but don't think i explained it well. I have a database with a
main switchboard. From the switchboard you can do various queries which are
linked to by command buttons. When you click the command button it closes the
switchboard and shows a dialogue box which asks for the criteria set up in
the query. If I click cancel at this point, the screen closes and I am left
with just the database window. I want the switchboard to open if I click the
cancel button. I know I have done it before but can't remember
how.......!!!
 
G

Guest

....or use a VBA module instead and include something like:

dim response%
response = msgbox("Your message about running a query",vbokcancel,"Run?")
if response = vbok then
'do your query stuff here
else
'reopen your switchboard here
docmd.openform "MySwitchboard"
end if
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top