Results 1 to 6 of 6
  1. #1
    Duncan is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Oct 2010
    Posts
    71

    Combobox form display order


    I have a multiselect combox in a form. When items are selected they appear in a different order that what was selected. When investigating the problem it appears that the on the table the data is sorted based on their ID number (pkID number). This is fine however Access puts any ID number starting with 1 (eg 16) before items that do not (e.g 2, 3, 4 thorough to 9). Any suggestions as to how to keep the display order based on the pkID number order (1 to ......)

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,958
    I haven't used multiselect combo/list boxes (I didn't think combobox could be multiselect) but have seen code that handles them.

    Where is it that the selected items are appearing - in a list box? Show the code that performs this manipulation. The PK is an Autonumber field? The code must be converting it to text string and numbers as text won't sort numerically. Somewhere have to convert back to numbers. Can use Val function for that. Or make the values all same length with leading fill characters such a spaces or 0's. (0001, 0016, etc). Format function can do that: Format("16","0000")
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    June7

    I haven't used multiselect combo/list boxes (I didn't think combobox could be multiselect)
    Apparently multi-select combo boxes are now available in A2007 & A2010. This recent thread has some discussion on them in case you're interested.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,958
    Bob, I think you forgot to post the link. I checked the properties for combo and list boxes. List box shows Multi-Select, combobox does not. So I am curious, even though never have had need for either.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    June7
    I think you're right. I'll put it down to tiredness (but I think it's age really). Anyway, the link is: http://www.access-programmers.co.uk/...d.php?t=214460
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,958
    Thanks Bob, mystery solved. I never set Lookup properties in tables so never caught that.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Combobox display order
    By Duncan in forum Queries
    Replies: 91
    Last Post: 09-01-2011, 05:12 PM
  2. Replies: 8
    Last Post: 06-22-2011, 10:51 AM
  3. Replies: 1
    Last Post: 03-24-2011, 07:09 AM
  4. Replies: 0
    Last Post: 08-24-2010, 06:38 PM
  5. Replies: 0
    Last Post: 12-16-2009, 01:14 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