Retaining my search text

ECEK

Registered User.
Local time
Today, 07:42
Joined
Dec 19, 2012
Messages
717
I am able to search on my form by entering all or part of the criteria and pressing return (as opposed to a search button) The textbox is unbound

I would like to retain the text that I am searching for.

This is useful for narrowing down the criteria.

Any thoughts?

I tried

Me.ClientSearch.SelStart = 1

but to no avail.
 
Not sure I understand but perhaps save to a tempvar or variable.
For example strSearch=me.clientsearch
 
Like when you type another text it will append to the previous text as another criteria.
You need to create a module wise variable:
Dim crit as string

Now when new text is written:
If crit <> "" then
Crit = crit & " and [field] like '*" & textbox & "*'"
Else
Crit= "[field] likr '*" & textbox & "*'"
End if


Yiu need a way to clear crit either using a button to clear the criteria:

private sub button_click()
Crit=""
Rnd sub
 

Users who are viewing this thread

Back
Top Bottom