Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

check if radio button is selected

Posted on 2004-09-29
4
Medium Priority
?
213 Views
Last Modified: 2009-12-16
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 !
0
Comment
Question by:Dayim
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 34

Expert Comment

by:flavo
ID: 12184439
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
0
 

Author Comment

by:Dayim
ID: 12184532
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

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

0
 

Author Comment

by:Dayim
ID: 12184538
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
0
 
LVL 66

Accepted Solution

by:
Jim Horn earned 1000 total points
ID: 12184593
Select Case Me.Frame0.Value
    Case 1
        'Close frmAll-Indiv

    Case 2
        'Do whatever

    Case Else
        msgbox "Whatever message you want to display to the user when nothing is selected."

end select
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question