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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Option Group Value

Status
Not open for further replies.

msofficebeginner

IS-IT--Management
Oct 11, 2005
10
0
0
DE
Hello,

I have my Option Group Value = Null, and I want to check with if condition that when this value is NULL do some action. But the error is the if condition does not execute, it goes to else part. May I know how to check this value, or is there any other method/trik.

Ex:
OptGp.Value = NULL

If ( OptGp.Value = NULL) Then
MsgBox " Value is NULL : "
Else
MsgBox " Its req. value"
End if

Thanks.
 
Did you mean it as an Option Button?
Here is a sample for one button
Code:
Private Sub Command11_Click()
    Select Case Me.Option9.Value
    Case Is = -1
        MsgBox "It has ticked"
    Case Is = 0
        MsgBox "It is empty"
    Case Else
        MsgBox "It is grayed"
    End Select
End Sub

________________________________________________________
Zameer Abdulla
Help to find Missing people
My father was a realistic father; not a vending machine dispense everything I demanded for!!
 
Anyway, to test if a variant is null:
If IsNull(varName) Then

In fact Null means Unknown and therefore If Null = Null is ALWAYS false.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top