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

option button values 1

Status
Not open for further replies.

barnard89

MIS
Mar 6, 2005
74
US
Hi

I am using Access 2000
I am using an Option group where I have 2 option buttons
opt_male and opt_female

In a command_click event , I wrote the following code

If opt_male is checked to true
It should give a message box
"You checked male option"
if opt_female is checked to true it should give
"You checked female option"

This the code that I wrote , but it is not working . Could any one please correct my code ?

if opt_male.value = 1 then
msgbox "You checked male option"
endif

if opt_female.value = 1 then
msgbox "You checked female option"
endif
 
If Me![name of frame].Value = 1 Then
MsgBox "You checked male option"
ElseIf Me![name of frame].Value = 2 Then
MsgBox "You checked female option"
Else
MsgBox "You checked option " & Me![name of frame].Value
End If

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