Results 1 to 4 of 4

Thread: List Box

  1. #1
    Join Date
    Apr 2004
    Posts
    35

    Unanswered: List Box

    Hi,

    I think this is very simple but I dont know how to do it.

    I have a list box and I want to show some items selected when the form opens. How do I do it???

    Help!!!!

    Thanks
    MARGA

  2. #2
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    You have just to adjust the RowSource of your ListBox
    Example: in the on Open event of the Form put
    yourListBoxName.RowSource = "SELECT * FROM yourTableName ORDER BY anyField"

  3. #3
    Join Date
    Apr 2004
    Posts
    35
    Thank you for you answer, but what I want is to show some items selected from that list. For example, if the list has 10 items, show 3 selected since the form opens.

    Do you know how to do it???
    MARGA

  4. #4
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    Hi margaquinon
    Presume what you want is to highlight items in a list based on values in the current record.
    It can be done, Theoretically you could set the items selected properties in the listbox (I have nver used that approach).I've always gone for a two list box approach, with items available (but not selected) in one listbox, items selected in another, and in some cases where there are many items (similarly described) in a third box)

    to implement this
    you place some code in the forms "current" to load the listboxes,you place code behind the "onclick" event of both list boxes, clicking a row in the list box transfers that record to the other list box

Posting Permissions

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