PDA

Click to See Complete Forum and Search --> : Option Buttons


Insane Killa
Nov 28th, 1999, 04:36 PM
Ok My Problem Is I Have 4 Option Buttons And 1 command button but I want it to ignore what the command button does normally when one of the option buttons is selected how do i do that?

I can get it so it does the option i select as well as what is already in the command button but it won't ignore what's already in the command button can someone give me a full example how to do this?

Andy Collyer
Nov 28th, 1999, 04:57 PM
If my understanding of your problem is that when one of your 4 option buttons is selected you do one thing and if nothing is selected you do something else, here's a quick snippet...

Private Sub Command1_Click()

Dim iCount As Integer, bSelect As Boolean

' this assumes your option buttons are a control array called "Option1"

For iCount = 0 to 3
If Option1(iCount).Value Then
bSelect = True
Exit For
End If
Next

If bSelect = True Then
' add your code for when an option is selected
Else
' add code for when no option is selected
End If

End Sub

------------------
* * * * * * * * * * * * * * * * * * * * * *
* *
* AndyC *
* London *
* email: andy.collyer@bigfoot.com *
* *
* * * * * * * * * * * * * * * * * * * * * *