Why doesn't this work!!!...

B

Brett Davis

Hello...

I am using Access 2003 and I am attempting to run this from a command
button:
CommandBars("Menu Bar").Controls("File").Controls("Page
Setup...").Execute

When I try to run this... I get this error message:

This action can't be carried out while processing a form or report event.
A macro specified as the OnOpen, OnClose, OnFormat, OnRetreat, OnPage, or
OnPrint property setting contains an invalid action for the property.

When I execute this:
CommandBars("Menu Bar").Controls("File").Controls("New...").Execute
or this:
CommandBars("Menu Bar").Controls("File").Controls("Close").Execute

It works!!!

I have the references set to Microsoft Office 12.0 Object Library. I have
also tried it with Microsoft Office 11.0 Object Library as well... the
command fails on both...

Please advise...

Thanks,

Brett
 
D

Douglas J. Steele

As far as I'm aware, Page Setup can only be invoked when the report is open
in Design view. Is that your case?
 

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