Select Row With Match Entry as 0-fmMatchentryFirstLetter

User avatar
adam
SilverLounger
Posts: 2347
Joined: 23 Feb 2010, 12:07

Select Row With Match Entry as 0-fmMatchentryFirstLetter

Post by adam »

I’ve added the code at Post 20118 to the workbook at Post 16710.

My intention is to filter the rows that contain the data related to the text which the user types in the text box txtEnterParameter.

Before placing the code at Post 20118 to the workbook at Post 16710, the corresponding row gets highlighted as the user writes the first letters of the word in the text box txtEnterParameter.

For example; if the user writes Ad instead of Adam, the row containing the word Adam gets highlighted and double clicking the highlighted row fills the appropriate text boxes.

In the current version, the user has to type the complete word if he wants to highlight and fill the text boxes by double clicking the highlighted row.
If the user type only half of the words and double click the highlighted row, excel VBA shows the debug message which points out the line.

Me.txtCustomerID = Me.ListBox1.Column(0)

I’ve set the list box Match Entry as 0-fmMatchentryFirstLetter

How could I make the code do both; meaning to highlight the row when the first few letters is written in the txtEnterParameter and to fill the appropriate textboxes on double clicking the highlighted row?
Best Regards,
Adam