Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2002

    Unanswered: Automatically selecting an item from a listbox.

    I have a listbox that has two columns, the first column is hidden and it is the primarykey/id of a table. The second column, is the text that is visible.

    I am running code that pulls DAO queries. after the result of the query, I want to set the listbox based on the result.

    So if the ItemID tied to the result of my query is 23, and that item is "Soap" I would like to have Soap automatically selected in my Listbox.

    However, if I set:
    ListboxName = 23

    then 23 is displayed in the listbox.

    I could join the query on another table to pull the text for Item 23, but I feel like that is somehow unnecessary since the RowSource for the listbox is already pulling that information down.

    Is there an easy way to do this?


  2. #2
    Join Date
    Nov 2001
    Set the width of the first column in your listbox to 0"

    Example: ColumnWidths = 0";3"


  3. #3
    Join Date
    Apr 2002
    okay...that's what I thought...something wasn't going right, though...I got frustrated, deleted the form and started works much better now....thank you for confirming that I was not insane...

Posting Permissions

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