Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Option button decision Problem

Status
Not open for further replies.

simeybt

Programmer
Nov 3, 2003
147
GB
All,
I am having a few problems with my option group.
I have an option group with a collection of three options. My first problem is I want the from to default to the first button once the form is open but when I try is on the on
Code:
Form_Load()
it tell me I cant do that. My second problem is that once one of the options is selected I can’t manage to find out which option is selected. I use the following code check of the first button is selected (which it is).
Code:
 If optCurrent = True Then
    MsgBox "test"
End If

Any ideas what I’m doing wrong here.

Simon
 
Hi

You do not test the value of the individual buttons in the option group, you test the option group

each button has a (numeric) value, when a given button is clicked, the option group takes on that value

so if your option group is called opgMyOption you say

Select Case opgMyOption
Case 0
...whatever
Case 1
Case 2
End Select

similalry when setting the value, you set the option group, not the individual option buttons

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Ahh things now become clear. teach me to try coding to early in the morning before my caffeine boost hits me

Thanks Ken

Simon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top