Results 1 to 4 of 4
  1. #1
    templeowls is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Feb 2019
    Posts
    305

    Can query criteria disregard spaces after the text is inputted?

    I have a query that has criteria which allows the user to filter to a certain customer ID. See below.



    Code:
    Like "*" & [Enter Customer ID] & "*"
    The users sometimes input the customer ID along with a space after the ID, and as such, nothing appears. This obviously leads to some confusion when the user doesn't realize that they put a space there.

    Is there any way to have access disregard the space? It's a customer ID field so there should never be an instance where a space ever even need to be inputted.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,967
    Try:

    Like "*" & Trim([Enter Customer ID]) & "*"

    However, advise not to use popup input parameters, instead reference a control on form for user input - which could be a combobox.
    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
    templeowls is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Feb 2019
    Posts
    305
    Thank you!!!

    However, advise not to use popup input parameters, instead reference a control on form for user input - which could be a combobox.
    I'm not sure that I know what you mean exactly. It's not a form. It's a report

    Are there any guides or videos online that you know of that you could provide? I'm interested to learn more about this

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,967
    I know it's a report.

    However, better to have user select criteria with input to UNBOUND controls on form and reference controls to build filter for report. Can better manage data validation. Review http://allenbrowne.com/ser-62.html
    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.

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

Similar Threads

  1. Filter on Form Control Based on User Inputted Criteria
    By MSAccessOldTimer in forum Forms
    Replies: 8
    Last Post: 07-30-2019, 10:48 AM
  2. Add spaces to query criteria through form entry
    By lorynhope in forum Programming
    Replies: 9
    Last Post: 01-29-2019, 12:16 PM
  3. Replies: 3
    Last Post: 11-14-2014, 02:51 PM
  4. Replies: 2
    Last Post: 07-09-2014, 06:41 PM
  5. Replies: 12
    Last Post: 06-12-2014, 07:37 AM

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