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

Using up Option Buttons 2

Status
Not open for further replies.

BabyPowder2u

Programmer
May 4, 2005
87
US
I am trying to set up control which will display one field or another based on an option button.
I created a frame called "Selection" and placed two option buttons in it.
I get an error no matter how I try to refer to the buttons (the below code gives error "Compile error: Variable not defined" and points to "Option1"

If Option1.Value = True Then
cboRoomName.Visible = False
Label6.Caption = "Room Type:"
cboRmType.Visible = True
Else
If Option2.Value = True Then
cboRoomName.Visible = True
Label6.Caption = "Room Name:"
cboRmType.Visible = False
cboRmType.Value = cboRoomName(1)
End If
End If

Can someone please show me the error of my ways :) Thanks,
T
 
Check the value of the Frame control:
If Me![Selection] = 1 Then
cboRoomName.Visible = False
...

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Thanks that took care of it. Now there is one more problem.
CboRoomName contains 3 columns. I would like to set cboRmType = to what is in the 2nd column in cboRoomName
I tried:
cboRmType.Value = cboRoomName(1)

I get the error "Access can't find "cboRoomName(1)" referred to...."

could you help me straighten this little error out?
Thanks,
T
 
Take a look at the Column property of the ComboBox object.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top