I have a spreadsheet which I wish to search when the user makes an entry
into any of the textboxes or a selection from a combo box.
Then I want the listbox to contain the records found from the search.
Though I want them ordered always in the following way
Name email address city zip telephone
Just like they are in the raw data spreadsheet.
So your first assestment is correct.
So this code would all go in the sub clickFind()??
'--------------------------
Private Sub TxtFirstName_Change()
stat = Search_String("FirstName", txtFirstName.Text)
End Sub
Private Sub TxtLastName_Change()
stat = Search_String("LastName", txtLastName.Text)
End Sub
'------------------
then create the function:
'------------------------
Function Search_String(ByVal FieldName, ByVal FieldVal)
Select Case UCase(FieldName)
Case "FIRSTNAME"
' insert find code here.
' either update an array and return to change event
' to update the listbox,
' or update the listbox from here.
Case "LASTNAME"
Case "ADDRESS"
Case Else
End Select
End Function