Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Matilda Hughes   on Oct 29 In MS Office Category.

  
Question Answered By: Gilbert Moore   on Oct 29

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

Share: 

 

This Question has 5 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Using Case to do a multi-textbox search Or get search suggestion and latest updates.


Tagged: