cant find the macro DoCmd

  • Thread starter Thread starter paul
  • Start date Start date
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
 
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.
 
thanks - now I get a runtime error 424

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