cant find the macro DoCmd

P

paul

ive put a button on a form and want to open a query :
form/design view/properties
then onclick =Event procedure
and on the build button
entered DoCmd.OpenQuery "FormResults", acViewNormal

and then i get a microsoft Access cant find the macro 'DoCmd'

the macro (or its macrogroup) doesnt exist..............

WinXP with Access97 SR-2
 
F

Fredg

Paul,
Your post is not clear as to what you have placed on
the command button's Click property line.
Is it exactly:
=Event procedure
Or is it
[Event Procedure]

Event Procedure] is the correct entry.

When the button with the 3 dots appears on that line, click that button.
When the event code window opens, write:

DoCmd.OpenQuery "FormResults"

Between the 2 already existing lines of code.

Close the code window. Run the query.

Note: acViewNormal is the default Query view.
You do not need to explicitly write it.
 
P

paul

thanks - now I get a runtime error 424

Ive checked the query name and tested it with another query - same result
 

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