Hi all,
I am lost and in need of help.
I have designed a form with a basic search function. It uses the method in the simple search example in this forum.
Basically, a listbox containing the values, requeries based on a textbox string. Using -
Like "*" & Control & "*"
I want to expand this. My listbox contains multiple values - and I would like to be able to query based on any of these values.
I have built a combobox so the user can select the field that they want the search to be based upon.
Assuming I have the right approach - I now need an 'OnChange' event for the combobox to update the query criteria.
eg.
Private Sub UpdateMyQueryCriteria()
Dim MyField As String
MyField = Me.CBO.Value
SELECT MyField FROM MyQuery
SET Criteria = "Like & Chr(34) &"*"& Chr(34) & "& Control &" & Chr(34) &"*" & Chr(34)"
End Sub
Hopefully this explains what I am trying to do. Could anyone offer me any advice how to get this working - or even whether this is the correct approach to the problem?
Thank you
A rather desperate Rob
I am lost and in need of help.
I have designed a form with a basic search function. It uses the method in the simple search example in this forum.
Basically, a listbox containing the values, requeries based on a textbox string. Using -
Like "*" & Control & "*"
I want to expand this. My listbox contains multiple values - and I would like to be able to query based on any of these values.
I have built a combobox so the user can select the field that they want the search to be based upon.
Assuming I have the right approach - I now need an 'OnChange' event for the combobox to update the query criteria.
eg.
Private Sub UpdateMyQueryCriteria()
Dim MyField As String
MyField = Me.CBO.Value
SELECT MyField FROM MyQuery
SET Criteria = "Like & Chr(34) &"*"& Chr(34) & "& Control &" & Chr(34) &"*" & Chr(34)"
End Sub
Hopefully this explains what I am trying to do. Could anyone offer me any advice how to get this working - or even whether this is the correct approach to the problem?
Thank you
A rather desperate Rob