Making a Pop Up "Combo Box" using a "Check Box"

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vincehallam
    New Member
    • Mar 2008
    • 1

    Making a Pop Up "Combo Box" using a "Check Box"

    Hi newby here sorry if this sounds bread and butter stuff.

    Using MS Access 2003

    On a Form I want two Combo boxes which are getting their data from a table. The Combo boxes are A "Price 1" & B "If Bank Holiday Price Two". Is it possible to have "Price 1" visible as default but then if I tick a check box to have "If Bank Holiday Price Two" pop up and the values in B be used when clicked instead of "A".

    Hope this makes sense ?
    Regards
    Vince
  • PianoMan64
    Recognized Expert Contributor
    • Jan 2008
    • 374

    #2
    Originally posted by vincehallam
    Hi newby here sorry if this sounds bread and butter stuff.

    Using MS Access 2003

    On a Form I want two Combo boxes which are getting their data from a table. The Combo boxes are A "Price 1" & B "If Bank Holiday Price Two". Is it possible to have "Price 1" visible as default but then if I tick a check box to have "If Bank Holiday Price Two" pop up and the values in B be used when clicked instead of "A".

    Hope this makes sense ?
    Regards
    Vince
    So Vince, If I understand your question, you're wanting to know if in the combo box, if you click a checkbox on the form you want the Price1 to display a different column in the Pricing table?

    If so,

    Here's what you're going to need to do:

    1. On the check box control, you need to get the properties of that control to display on the screen.
    2. Scroll down through the properties until you locate the OnChange Event.
    3. in the OnChange event there is a little button off to the right of that entry field there once you click on it, that will display ... to the right of the entry field.
    3. click the ... button
    4. Paste the following code -> you will have to change the field names to what is in your table so that it works as well as the table Name and control names as well.

    [code=vb]

    If me.checkboxCont rolname.value = True then
    me.comboboxcont rolname.rowsour ce = "SELECT ID, Description, Price2 FROM PriceList"
    else
    me.comboboxcont rolname.rowsour ce = "SELECT ID, Description, Price1 FROM PriceList"
    End if
    [/code]

    Comment

    Working...