NotAnExpert
Registered User.
- Local time
- Today, 19:23
- Joined
- Feb 3, 2017
- Messages
- 46
Hi all, I am trying to gather a bit more knowledge and am working towards a search form which will help me through my day a bit more efficiently.
I have a mainform, and a subform.
The main form is unbound and has several textboxes which when not null or empty, are used as query criteria to filter the information from one large text field called 'description' on the main table to the subform. Now this works well, but I've seen this Split() function which I imagine will be more useful in future.
My example is as follows:
At the moment the test simply hands message boxes with the split data previously entered into the search textbox. Yaye, the split function is collecting data from the right place and giving it back to me.
What I was wanting this to do is us the searchArray(i) result as the query criteria...
I'm just not sure how to formulate it.
Any pointers would be great, thank you.
I have a mainform, and a subform.
The main form is unbound and has several textboxes which when not null or empty, are used as query criteria to filter the information from one large text field called 'description' on the main table to the subform. Now this works well, but I've seen this Split() function which I imagine will be more useful in future.
My example is as follows:
Code:
Private Sub txtSearch_AfterUpdate()
Dim searchArray() As String
searchArray = Split(Me.txtSearch.Text, ";")
Dim i As Integer
For i = LBound(searchArray) To UBound(searchArray)
MsgBox "Search Text: " & searchArray(i), vbOKOnly, "Your Search"
Next
End Sub
At the moment the test simply hands message boxes with the split data previously entered into the search textbox. Yaye, the split function is collecting data from the right place and giving it back to me.
What I was wanting this to do is us the searchArray(i) result as the query criteria...
I'm just not sure how to formulate it.
Any pointers would be great, thank you.