Results 1 to 6 of 6
  1. #1
    Join Date
    Oct 2003
    Posts
    5

    Unanswered: Access and ListBoxes

    OK. I want 2 list box controls. One will be loaded from a recordset...no problems. The other will be next to the first and blank, until a user clicks Add/Remove buttons, essentially moving the items between the list boxes. However, there is no .AddItem method to the Access list box controls! How could I do this?

  2. #2
    Join Date
    Oct 2003
    Location
    Canada
    Posts
    574
    You can have them based on the same recordset except the first one shows all and the second shows only those there ChosenBox has been set to -1 by the first list box. This may require a few refreshes though.

  3. #3
    Join Date
    Oct 2003
    Posts
    5
    ChosenBox property ??

  4. #4
    Join Date
    Oct 2003
    Location
    Canada
    Posts
    574
    Chosenbox would have to be in the recordset and each update of the first listbox would have to update that field to Yes when selected and No when not selected.

    Let me try again.

    create a temp table with the fields you want to show and include a ChosenBox field as integer

    create the 2 list boxes based on this new temp table

    on open of the form get it to populate the temp table with Chosenbox as 0

    on_change of the first box, get it to update the records in the temp table

    requery the second list box and the selected records should show up.

    This may not be the most elegant solution, but it was the first one I thought up.

  5. #5
    Join Date
    Oct 2003
    Posts
    5
    I actually did something like this before reading your last post, but with two temp tables. I am going to change my code to use one temp table like you suggested. Thanks!

  6. #6
    Join Date
    Sep 2003
    Location
    UK
    Posts
    13
    You could also experiment with code similar to that at;

    http://www.applecore99.com/frm/frm047.asp

    This seems to do exactly what you want with no temporary tables required.

    HTH

Posting Permissions

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