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!

Trouble changing a set of radio buttons to a drop down box.

Status
Not open for further replies.

jimtmelb1

Technical User
Sep 7, 2003
72
AU
Hi,

I have an Access 2000 database. I need to change a set of radio buttons to a drop down box. The field for the radio buttons is a Yes/No field. I'd rather not change the field in the backend database but i want to know if possible can I have a drop down box where the control source is a Yes/No Field. My two values in the drop down box are "Paid" and "Unpaid".

If possible can someone show me how?

Thanks
 
Hi jimtmelb1,

Use the wizard to add an un-bound combobox your form.
Add the 2 values you want, Paid and Un-Paid.

Next add some code to the VBE window.
something like this should work
Code:
Private Sub ComboBoxPaid_AfterUpdate()

Select Case ComboBoxPaid.value
    Case "Paid"
        OptionBtnPaid.value = True
    Case Else
        OptionBtnPaid.value = False
End Select

End Sub

Private Sub Form_Load()

Me.OptionBtnPaid.Visible = False
Me.OptionBtnPaid.TabStop = False
Select Case Me.OptionBtnPaid.value
'Returns 0 if un-checked, -1 if it checked
    Case 0
        Me.ComboBoxPaid.value = "Un-Paid"
        'OR
        Me.ComboBoxPaid.value = ""
    Case Else
        Me.ComboBoxPaid.value = "Paid"
End Select

End Sub



AccessGuruCarl
Programmers helping programmers
you can't find a better site.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top