Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2012
    Posts
    98

    Unanswered: Return relative position of selected item in combo box?

    I have a combo box on an Access form that is formatted to display 15 rows only.

    I can find the index of the selected item using the list index but I want to know which one of the 15 displayed rows has been selected. Is this possible?

    In other words I want the position of the selected item relative to the 15 rows that are displayed instead of the position relative to the entire data source.

    Many thanks in advance.

    Dave

    (using Access 2000)

  2. #2
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    602
    Provided Answers: 31
    Why make this hard? The combo box is for picking the item you want.
    If you see Bob Smith in the list, you pick Bob Smith and the combo returns Bob Smith.
    (you can also return the keyID Bob is assigned.)
    But to pick the order that Bob currently holds doesnt sound productive.

  3. #3
    Join Date
    Apr 2017
    Posts
    10

    Return relative position of selected item in combo box

    AFTER UPDATE

    Dim ComboSelected As Integer
    ComboSelected = Me.Combo1.ListIndex
    MsgBox ComboSelected


    This will give you the line number of the item selected...

  4. #4
    Join Date
    Apr 2017
    Posts
    10

    Return relative position of selected item in combo box

    SORRY!!!
    I INCORRECTLY NAME THE FIELD THE SAME AS THE COMBO BOX

    AFTER UPDATE

    Private Sub Combo1_AfterUpdate()
    Dim ComboSelect As Integer
    ComboSelect = Me.Combo1.ListIndex
    MsgBox ComboSelect


    Thats better...

Posting Permissions

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