Results 1 to 5 of 5
  1. #1
    jjmclell is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2015
    Posts
    11

    Display value in combo box

    I have two combo boxes, both unbound. One serves as a filter for the other. For example, the first one lists different 'partner groups'; based on the user's selection, the second combo box is filtered to only show 'partners' that fall into that group...this is done by updating the rowsource of the second combo box after updating the first.

    I would like the second combo box to display "---Select partner---" after updating the first combo box but can't get it to show anything. "---Select partner---" shows on form load, but after doing one filter and selection of the second combo box, "---Select partner---" fails to show after updating the first combo box again.

    I added an AfterUpdate event to the first combo box, but it doesn't do what I'd like:

    Code:
    me.cmb_Partner.value = "---Select to add---"
    Any ideas?

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    "---Select partner---" is not a choice in the list, so it may not show up.
    LIMITTOLIST = yes

    or the KEY field wont allow it.
    (i dont think you need it, people know how it works)

  3. #3
    jjmclell is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2015
    Posts
    11
    That was it. I wasn't aware of the LimitToList property.

    One follow-up question - should I be setting the value property or the text property to "---Select partner---"? I know it seems redundant to show this text in a combobox, but I do have a reason...

  4. #4
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    You could make it part of the list and/or set it to DEFAULT VALUE.

  5. #5
    jjmclell is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2015
    Posts
    11
    It became too complicated trying to account for all the instances in which I needed the combobox to show a default value of "---Select partner---", especially after changing its rowsource based on a selection made in the first combobox (this confounded the idea of simply adding "---Select a partner---" as a record to the Partners table).

    What I ended up doing is simply making the text in the combobox white until the user puts the focus on it. Since the combobox was unbound, it would retain the selection from the last record when I moved to subsequent records and the info it showed wouldn't necessarily make sense. By just making the text white in certain instances, and then turning it back to black in other instances, I was easily able to ensure it didn't show anything irrelevant to any particular record. I can live without the common sense display value of "---Select partner---"

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Combo Box display
    By RayMilhon in forum Forms
    Replies: 1
    Last Post: 07-06-2015, 05:10 PM
  2. Combo box display
    By crowegreg in forum Forms
    Replies: 3
    Last Post: 07-13-2012, 12:24 PM
  3. Combo box dafault display value !!!
    By Kazim in forum Access
    Replies: 1
    Last Post: 02-28-2011, 09:31 AM
  4. Replies: 7
    Last Post: 02-07-2011, 10:11 PM
  5. Combo Box Display
    By ssaucedo in forum Reports
    Replies: 17
    Last Post: 08-10-2009, 05:52 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums