Link to home
Start Free TrialLog in
Avatar of Dayim
Dayim

asked on

check if radio button is selected

I have a form with  two radio buttons and a command button that activates a certain event. The user will naturally make a choice from either one of the radio buttons and click the command.
Question:
How do i place code on that event (command button) that displays a message in the case that the user does not choose either of the radio buttons ??

Thanks a million !
Avatar of flavo
flavo
Flag of Australia image

private sub cmdMyButton_click()

If Me.myOption1.value =  0 and Me.myOption2.value  = 0 then
   'neither are selected
    Msgbox "Nooo!!!!"

else
    'what ever you do
end if

end sub
Avatar of Dayim
Dayim

ASKER

My friend, this is how the rest of the radio buttons work :

If Me!Frame0 = 1 Then
' closes frmAll-Indiv

ElseIf Me!Frame0 = 2 Then

End If

.......................................

Avatar of Dayim

ASKER

Ignore, previous thread ...
My friend, this is how the radio buttons code look in my application :

If Me!Frame0 = 1 Then
' closes frmAll-Indiv

ElseIf Me!Frame0 = 2 Then

End If
ASKER CERTIFIED SOLUTION
Avatar of Jim Horn
Jim Horn
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial