I have an unbound field that I use to search. Is there a way to change any spaces in what is typed into this field to asterisks?
Thank you for the help.
I have an unbound field that I use to search. Is there a way to change any spaces in what is typed into this field to asterisks?
Thank you for the help.
For what purpose?
Replace() function can do that.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Since it is a search field I want to put in the asterisk wild card in case they put in two words and they are not next to each other in the results. This way it will still find something with those two words.
What you are asking is possible. But, it may not be an optimal approach. If the intent of your search is to get a specific result or family of results, then "organizing/managing" the search criteria may be required. If, on the other hand, you simply want "anything" to be returned regardless of what search criteria is entered, then your approach will suffice.
By "organizing/managing" I'm suggesting some algorithm/code to adjust the search criteria with "and" or "or" as appropriate. Finding "anything" is OK if you are simply browsing. But since you are searching, you are looking for something specific.
For this search box is a string that can have many different words in it. It can be misspelled and I would rather have some results rather than no results. Thank you for the guidance I ended up using the code below.
Code:Dim SRCH As String SRCH = Replace(Me.SRCH_DESC, " ", "*")
Good stuff. Glad you have it resolved.