Just a heads up
Here we see he populates the combobox with the names of the facilities in
column B
txt_Facility_Name.AddItem (ActiveSheet.Cells(i, 2))
here we see his lookup range starts in column 1 which if you look back at
his post contains sequential numbers beginning with 1
Set rng_facilities = Range("A2", "I300")
txt_Facility_Street.Value = WorksheetFunction.VLookup _
(facilities_current, rng_facilities, 3, False)
So he should be using the listindex property as he currently is doing
----------------------------
I think, since he loads data into the Combbox on the DropButtonClick event,
he needs to add a line to remove the existing values
Private Sub txt_Facility_Name_DropButtonClick()
Dim i As Integer
Worksheets("Facilities").Activate
facilities_count = ActiveSheet.Cells(600, 1).End(xlUp).Row
'
' Add the next line
'
txt_Facility_Name.Clear
For i = 2 To facilities_count
txt_Facility_Name.AddItem (ActiveSheet.Cells(i, 2))
Next i
End Sub
--
Regards,
Tom Ogilvy
"Leith Ross" wrote
in message ...
Hello SP,
The ListIndex property is updated when the user selects an item in the
ComboBox List. ListIndex is a subproperty of the List property. You
code should read...
Code:
--------------------
Private Sub txt_Facility_Name_Click()
' Get index number of selected record
With txt_Facility_Name
facilities_current = .List(.ListIndex) + 1
End With
populate_facilities
End Sub
--------------------
Sincerely,
Leith Ross
--
Leith Ross
------------------------------------------------------------------------
Leith Ross's Profile:
http://www.excelforum.com/member.php...o&userid=18465
View this thread: http://www.excelforum.com/showthread...hreadid=479989