option buttons in frame problem.

G

Guest

Hi,

I created a frame with 3 options buttons in it. I used the access forms
wizard to create the 3 option buttons within the frame.

I am trying to write some code to determine which
if an option button is selected.

if me.option1.value = true then
do something
end if

however I get the error message:
error: 2427 "you entered an expression that has no value".

it works if I create an option button by itself outside the frame.

what have i done wrong, especially since I created the options buttons
through the
wizard.

Thanks

Chris
 
F

fredg

Hi,

I created a frame with 3 options buttons in it. I used the access forms
wizard to create the 3 option buttons within the frame.

I am trying to write some code to determine which
if an option button is selected.

if me.option1.value = true then
do something
end if

however I get the error message:
error: 2427 "you entered an expression that has no value".

it works if I create an option button by itself outside the frame.

what have i done wrong, especially since I created the options buttons
through the
wizard.

Thanks

Chris

It sounds as though option1 is the name of the individual button
within the Option Group (which by default is named FrameX, X being a
number).
An Option Group gets it's value from the selected button in the group.
The individual button's value need not be read, and has no value
outside of the group.
Try:

if Me!FrameName = 1 then
do something
Elseif FrameName = 2 Then
do something else
Else
do the number 3 thing
End If
 
M

Marshall Barton

Chris said:
I created a frame with 3 options buttons in it. I used the access forms
wizard to create the 3 option buttons within the frame.

I am trying to write some code to determine which
if an option button is selected.

if me.option1.value = true then
do something
end if

however I get the error message:
error: 2427 "you entered an expression that has no value".

it works if I create an option button by itself outside the frame.

what have i done wrong, especially since I created the options buttons
through the
wizard.


Controls within an option group do not have a value.

The OptionValue property of the selected control is stored
in the option group control's Value property.

If Me.option1.OptionValue = Me.frame12.Value Then
do something
End If
 

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