Results 1 to 5 of 5

Thread: Method for maintaining listbox possible values
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    Board Regular
    Join Date
    Feb 2007
    Posts
    353
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)

    Default Method for maintaining listbox possible values

    Hi,

    I'm usually an Excel person and not so much an Access person so please forgive my stupid question:

    I plan to build a database which in various forms rolling up into various tables I want to control selection choices a user can make. Some of these list might be 3 options long, some might be 5, and i know of at least one that is 10. But what is the best way to makes these selection choices maintainable by a user? The scenario would be a user has just encountered a new type of thing not preciously reflected in a drop-down choice. Certainly until this database gets established.

    Is the below approach the right way to manage this, or should I be thinking of something else?

    Would I have a tblUserStatic
    Field 1: Listbox_Name
    Field 2: Selection group description
    Field 3: Selection_Value

    I could then query this and sort A-Z or groupby count when populating a listbox in a form?

    Another form could link to this table for the purpose of adding/removing items

    Thanks,

    Andrew

  2. #2
    Board Regular
    Join Date
    May 2013
    Posts
    647
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Method for maintaining listbox possible values

    That is what I would do, with perhaps an additonal field for sort order, then sort by that and then Selection_value.?
    Office 2007
    Access novice. Sometimes trying to give something back

  3. #3
    Board Regular JonXL's Avatar
    Join Date
    Feb 2018
    Posts
    213
    Post Thanks / Like
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Method for maintaining listbox possible values

    It's a good approach. A couple of thoughts, though:

    1. Since users can't change list boxes, the selections for this field should be hard-coded so they don't have to be separately typed in.
    2. Have a separate table holding the possible group values (or hard-coding those, too, if they don't change).

  4. #4
    New Member
    Join Date
    Dec 2009
    Posts
    10
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Method for maintaining listbox possible values

    If I understand what you are after, this ability for users to edit lists is baked in.

    See:
    https://docs.microsoft.com/en-us/off...titemseditform
    and/or
    https://docs.microsoft.com/en-us/off...titemseditform

  5. #5
    Board Regular
    Join Date
    Jun 2015
    Location
    Ontario, Canada
    Posts
    1,698
    Post Thanks / Like
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Method for maintaining listbox possible values

    there is also the Not In List event for a combo box, which doesn't require a form for editing list items. However, it can be problematic if not done correctly, and requires additional code if more than one value needs to be added (as in the case where a combo box list has multiple fields and each one is required at the time of inserting new data).
    Tips for posting problems:
    1) "doesn't work" doesn't help. Post error message text/numbers and/or state what's happening.
    2) if posting code or sql, use code tags; specify on which code line errors occur, if applicable
    3) try to be specific; assume we know nothing about your issue - because we don't!

    Make all suggested changes in copies of your database or to its objects.

    "1 out of 1010 people understand binary. The other 1001 don't."

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •