Solved

check if radio button is selected

Posted on 2004-09-29
4
212 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 250 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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

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
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
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…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

636 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