userform inputs

J

Jo

Hi
Sorry I don't know how to do this.
This is the code I am using to find out which option is
selected.

'Private Sub CommandButton1_Click()
'For Each x In Frame2.Controls
'If x.Value = True Then
'MsgBox x.Caption
'End If
'Next
'Me.Hide
'End Sub

I then cannot dim and set the value (even if I use dim as
msforms.optionbutton)

Subject: userform inputs
From: "Ed" <[email protected]> Sent: 9/19/2003
2:50:11 PM

Jo,

The option box's Value property is:
-1 True. Indicates the item is selected.
0 False. Indicates the item is cleared.

You can set up a variable to hold the value and the use
the variable else where.
 
E

Ed

Jo,

You would need a second routine to test it, right?
Add a second command button and try something like:

Private Sub CommandButton1_Click()
Dim userSelected as String
For Each x In Frame2.Controls
If x.Value = True Then
userSelected = x.Caption
End If
Next
Me.Hide
End Sub

Private Sub CommandButton2_Click()
MsgBox userSelected
End Sub
 

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

Similar Threads


Top