Error message when using Modal Form

B

Bob H

I have created a datbase for work containing many tables, forms and reports
for all the various types of tools and equipment we supply.

Using Access 2007, I have created a Modal Form, using a little help frpm
a book on this, to preview and print the various reports. I have also
created a Macro group to operate the various selctions which can be made.
So from the book a Modal Form with just 3 options for now, with a
Preview, Print and Cancel Buttons. For the Macro group I have under
Macro name: Preview Reports
Then under Condition I have [Choose Report]=1 [Choose Report]=2 and
[Choose Report]=3,
and then under Action I select the apprpriate report to Preview.
Then when I run the modal form and click on Preview, I get an error
messagetelling me:
The object doesn't contain the Automation Object 'Choose Report'.

If I remove '[Choose Report]=1' etc and click 'Preview' on the form all
of the reports are opened together.
So what have I missed?

Thanks
 
S

Steve Schapel

Bob,

What is [Choose Report]? From your description, my best guess is that
it is an Option Group with 3 option buttons, for the purpose of
selecting one of 3 reports... is that correct?
 
B

Bob H

Steve said:
Bob,

What is [Choose Report]? From your description, my best guess is that
it is an Option Group with 3 option buttons, for the purpose of
selecting one of 3 reports... is that correct?

Steve,
yes that is correct, as the 3 options are numbered 1-3, so the
first one, i.e [Chosse Report]=1 is the first option in the group which
equates or bound to a particular report, and so on.

Thanks
 
S

Steve Schapel

Bob,

Therefore I am unsure why you are getting that error message. Make sure
you have the exact correct spelling for the name of the Option Group in
your macro Condition.
 
B

Bob H

Steve said:
Bob,

Therefore I am unsure why you are getting that error message. Make sure
you have the exact correct spelling for the name of the Option Group in
your macro Condition.
Hi Steve, well I checked the spelling and it is the exact same spelling
and format as in the book : How to do everything with Microsoft Access
2007, page 466.
Anyway, thanks for your time; maybe I'll try getting in touch with the
author of the said book.

Thanks
 
S

Steve Schapel

Bob,

I understand that you are following an example in a book. However, when
checking for errors, we need to double-check the actual work. I noticed
that even in your posts here, on one occasion you called the control
[Choose Report] and on another you called it [Chosse Report]. These
things happen. Regardless of what's in the book, you need to check the
*actual* name that you have given the Option Group control as shown in
the properties in design view of the form, and make sure that it is
exactly as you have put in the Condition column of your macro design.
 

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