Results 1 to 7 of 7
  1. #1
    Join Date
    Jun 2009
    Posts
    3

    Unanswered: Access 2003: Multiselect listbox - saving and restoring

    Database created to enter workplan for the Section, which has tables for Staff, Team, Objectives and Activities. Each objective has one or more related activities, and each staff member belongs to only one team. There is an objective form and activities sub-form.

    Each activity may have one person, multiple people (same or different teams), an entire team or multiple teams working on it. As such, I added a listbox which is populated by a query which unions the staff and team tables to provide a list of all staff and teams. My desired outcome is twofold:

    1) Make selection(s) from the listbox and save to a table (or field?);
    2) Be able to reflect the selections when the forms are being browsed.

    I have not created the table (or field?) to house the listbox selections yet, since I'm not sure what I'll be saving to it. I will also be generating reports, but I'm hopeful that if the right data is saved this should not be too traumatic.

    Hope this isn't too long and I am clear. Any assistance that can be provided will be greatly appreciated!

  2. #2
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    Sounds like you need a relationship rather than a multi-select listbox to me...
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  3. #3
    Join Date
    Jun 2009
    Posts
    3
    StarTrekker, can you clarify?

  4. #4
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    I'll try.

    I think you are trying to accomplish something that shouldn't be attempted -- using a multi-select list box instead of defining and using table relationships.

    OBJECTIVE
    ObjectiveID
    Description
    ... etc.

    ASSIGNMENT
    ObjectiveID
    PersonID

    ... etc.

    PERSON
    PersonID
    Firstname
    Surname
    ... etc.

    Relating these tables with 1 objective to M assignment and 1 person to M assignment creates a many to many relationship between person and objective. Design forms and subforms to support that platform and you won't need multi-select list boxes, nor do you need to write the code needed to store and retrieve the data that such a list box has selected.
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  5. #5
    Join Date
    Jun 2009
    Posts
    3
    Many thanks...will try to implement this way...

  6. #6
    Join Date
    Apr 2009
    Posts
    21

    VBA Code

    Can you give me a model of the VBA code that I could follow that would enable me to get my multiselect listbox working?

  7. #7
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    Quote Originally Posted by Phillip Russell
    Can you give me a model of the VBA code that I could follow that would enable me to get my multiselect listbox working?
    Duplicate post:

    http://www.dbforums.com/microsoft-ac...t-listbox.html
    Paul

Posting Permissions

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