Results 1 to 3 of 3

Thread: Listindex

  1. #1

    Thread Starter
    Lively Member
    Join Date
    May 2004
    Location
    Cleveland,Oh
    Posts
    95

    Listindex

    Hi All:
    How can I select the Listindex of a combobox or listbox?

    I am populating the combobox in the following manner:

    For i = 1 To oRecData.RecordCount
    With Form2.cmboevebldg
    sDesc = oRecData.Fields("Location_Name") & Space(60) & "$" & CStr(oRecData!Location_ID)
    .AddItem sDesc
    .ItemData(.NewIndex) = oRecData!Location_ID
    End With
    oRecData.MoveNext
    Next i

    I need the location_ID

    Thanks
    Zus

  2. #2
    Addicted Member
    Join Date
    Aug 2002
    Location
    Luton, UK
    Posts
    178
    I do not fully understand your code, but ListIndex is a number starting at zero that determines the selection. So this selects the first item in the combobox :-

    Code:
    Form2.cmboevebldg.ListIndex = 0
    Regards
    BrianB
    -------------------------------

  3. #3

    Thread Starter
    Lively Member
    Join Date
    May 2004
    Location
    Cleveland,Oh
    Posts
    95

    Resolved:Listindex

    Hi BrianB:
    Thanks for getting back to me. I got the answer I was looking for.

    Thanks again
    Zus

Posting Permissions

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



Click Here to Expand Forum to Full Width