I have an Option Group on my form already. What is the object name

C

Chuck A

I have Access 2007 with a form. I used the wizzard to add an Option Group
with Two choices. [] Ship Date [] Bill date
I want to write a bit a of VBA code to change a variable based on the value
of the Option Group. (Ship Date = 1 ; Bill Date = 2)
So my code should say:
....
IF Me!optGroupName = 1 THEN .... ELSE ....

I can't find anything on the Form that tells me the actual vaule for the
Option Group Object name { I used optGroupName above, but I have no idea what
it is on my form}

I [right-clicked] on everything I can and the best I could get is an Object
called Option35 when I select the Ship date Option and "Option36" for the
Bill Date Option.
It's like they are not part of the same Option Group.

Scratching my head...
 
J

Jeff Boyce

Chuck

In design view, click on the Option Group (box) surrounding the options.
This is the object you are searching for the name of.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
L

Linq Adams via AccessMonster.com

In pre-2007 versions, all you have to do is look at the Option Group in
Design View or Form View. At the top of it, it'll say something like Frame0
or Frame2, etc. This is what you refer to in code

If Me!Frame0 = 1 THEN .... ELSE ....
I assume this holds true in v2007 as well.
 
J

Jeff Boyce

True as long as the developer hasn't renamed the controls to something more
meaningful/descriptive than "Frame0"...<g>

Regards

Jeff Boyce
Microsoft Office/Access MVP
 

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