Results 1 to 6 of 6
  1. #1
    caniread is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2015
    Posts
    86

    Change any spaces to asterisks in unbound text box

    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.

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,816
    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.

  3. #3
    caniread is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2015
    Posts
    86
    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.

  4. #4
    orange's Avatar
    orange is online now Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    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.

  5. #5
    caniread is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2015
    Posts
    86
    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, " ", "*")

  6. #6
    orange's Avatar
    orange is online now Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 5
    Last Post: 01-07-2019, 01:51 AM
  2. Input box password in asterisks
    By AmanKaur123 in forum Programming
    Replies: 5
    Last Post: 03-08-2017, 08:14 AM
  3. Replies: 2
    Last Post: 07-09-2014, 06:41 PM
  4. Replies: 7
    Last Post: 12-11-2013, 03:43 PM
  5. Replies: 3
    Last Post: 08-08-2010, 12:21 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums