In the form declaration, make some globals:
Private mvar_zFore() As String
Private mvar_zSur() As String
Private mvar_zYear() As String
In the Form_Load sub, read the file, redim the globals, and store the values. Then for each Text box change (and at the end of the Form_Load) clear the list and compare the contents of each text box to the corresponding variable. If you get a matches in all three, add the item to the list.
<pre class="ip-ubbcode-code-pre">For i = 1 To ubound(mvar_zFore) If InStr(1, mvar_zFore(i), Text1.Text) > 0 Then If InStr(1, mvar_zSur(i), Text2.Text) > 0 Then If InStr(1, mvar_zYear(i), Text3.Text) > 0 Then List1.AddItem mvar_zFore(i) & " " & mvar_zSur(i) & ", " & mvar_zYear(i) End If End If End IfNext i</pre>
|