Results 1 to 9 of 9
  1. #1
    New Lounger
    Join Date
    Mar 2003
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Populating List Boxes (Access 97)

    I have a form for choosing software to be installed on PCs. On the left, I have a list box that lists all the applications available (from the tblApps table). I would like to have another list box on the right that lists all the applications that have already been chosen to be installed for that particular PC. I would like to be able to choose applications from the left list box and add them to the right one, and be able to choose from the right one to take off the list (similar to the wizards in Access when you have to choose the fields you want included in a form).

    I have been working on it all morning and I'm VERY FRUSTRATED. HELP!

    Thanks! <img src=/S/brickwall.gif border=0 alt=brickwall width=25 height=15>

  2. #2
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Populating List Boxes (Access 97)

    It would be hard to give specific advice without knowing how you are keeping track of which applications where already installed. Basically, In the left listbox I would list all applications not already installed. You can do this by selecting items from the applications table that are not in the other table. I think there is a query wizard selection that will do this for you.
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  3. #3
    New Lounger
    Join Date
    Mar 2003
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Populating List Boxes (Access 97)

    The applications that need to be installed are in a separate table called tblChosenApps. It has a field for the Asset Tag and a field for the ApplicationID. This is the table I need to populate with the choices that the user makes. However, I need to make it so that if they choose 5 applications to be installed today and they want to change that information tomorrow, they can add or delete from the list.

  4. #4
    3 Star Lounger
    Join Date
    Mar 2001
    Location
    Minneapolis, Minnesota, USA
    Posts
    262
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Populating List Boxes (Access 97)

    I think you want the following:

    Left list box is based on a query that shows all records in tblApps that are not in tblChosenApps for that Asset Tag; Right list box is based on a query that shows all records in tblChosenApps for that Asset Tag.

    The action for the button that allows allows you to choose an app from the left list box would (1) Add that app's ID and the Asset Tag to tblChosenApps, and then (2) requery both list boxes. The app would then magically disappear from the left list box and show up in the right list box.

    Unselecting an app would be the same process, but in reverse and followed by a delete query on tblChosenApps. Or am I misunderstanding your desired functionality?
    <font face="Comic Sans MS"><font color=blue>~Shane</font color=blue></font face=comic>

  5. #5
    New Lounger
    Join Date
    Mar 2003
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Populating List Boxes (Access 97)

    That's exactly what I want to do, but I have several problems:
    When I try to base my list box on a query and I put a WHERE clause in to look for the Asset tag number that is in the form, it doesn't work. I haven't used list boxes a lot, so I don't know what I'm doing wrong.

    Basically, my query has to use 2 tables:
    tblChosenApps has the Asset Tag # and Applications
    tblApps has the applications that are available.

    My form is based on the tblSystemsAndUsers table, which has the Asset Tag #, along with information about the User. When I put the WHERE clause into the query that the list box is based on (telling it to look at the Asset Tag field on the form), it doesn't work.

  6. #6
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Populating List Boxes (Access 97)

    You have a tblApps and a tblChosenApps. Use the "Find Unmatched Records" query wizard to find all the records in tblApps that aren't in tblChosen Apps. Use this a rowsource for your left listbox.
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  7. #7
    New Lounger
    Join Date
    Mar 2003
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Populating List Boxes (Access 97)

    I used your suggestion. It works. Thanks! <img src=/S/joy.gif border=0 alt=joy width=23 height=23>

  8. #8
    New Lounger
    Join Date
    Mar 2003
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Populating List Boxes (Access 97)

    Thanks for your help. I figured it out. I was doing the query wrong. I actually had to create a query that had the Asset tag # in it, then base the list box on a query with that initial query and the list of applications. It's working. <img src=/S/joy.gif border=0 alt=joy width=23 height=23>

  9. #9
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Newbury, Berkshire, England
    Posts
    712
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Populating List Boxes (Access 97)

    I had this example mdb titled "25 Cool Control Tricks" on CD with Cary Prague

Posting Permissions

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