access option group value

S

Souris

I have a group option on the form and would like to have a case statement to
excute the code depends on user option selected.

The frame only has default value which does not change.
Are there any property to access option value or I have to use if statement
to check which option user selected.


Your information is great appreciated,
 
K

Klatuu

When you query the value of an option group, it will return the Option Value
property of the option control currently selected. So if you have 4 option
buttons and they have option values of 1, 2, 3, and 4, and the Default Value
of the Option Group is 1, then when you open the form, the button with the
option value of 1 will appear as selected.

When you click one of the option buttons, the value of the Option Group will
change to the option value of the button selected and its After Update event
will fire. This is where you would put your select statment:

Private Sub MyOptionGroup_AfterUpdate()

Select Case Me.MyOptionGroup
Case 1
Case 2
Case 3
Case 4
End Select
 

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