Help with creating Drop Down Combo Box

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • AccessLPlates
    New Member
    • Sep 2013
    • 2

    #1

    Help with creating Drop Down Combo Box

    I have a table with a list of names and then multiple phone numbers across 3 columns, ie Home Phone, Mobile, Work, and want to create a drop down combo box that selects the "preferred" number to be used. How do I do this?

    Thanks
  • jimatqsi
    Moderator Top Contributor
    • Oct 2006
    • 1293

    #2
    If your combo box is named "PhoneList_ cbo" you could write in the OnCurrent event of the form:
    Code:
    Me.PhoneList_cbo.Rowsource = me.[Home Phone] & ";" & me.Mobile & ";" & me.Work & ";"
    This will change the choices in your combo box every time you settle on a new record. That may be a little confusing at first if you are dealing with a continuous form but should not be a problem.

    This assumes you have a one-column combo box. You could label the entries in a two-column combo box by adding "somelabel" & "; before each of the various phone numbers in the rowsource. Also, it would not be a bad idea to add some code to avoid putting blank entries into your combo box.

    Jim
    Last edited by jimatqsi; Sep 6 '13, 11:15 AM. Reason: correct code

    Comment

    • AccessLPlates
      New Member
      • Sep 2013
      • 2

      #3
      Thanks jimatqsi. It worked like a champ.

      Comment

      Working...