Solved

check if radio button is selected

Posted on 2004-09-29
4
207 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
  • 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 65

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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

In the article entitled Working with Objects – Part 1 (http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_4942-Working-with-Objects-Part-1.html), you learned the basics of working with objects, properties, methods, and events. In Work…
Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

757 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now