Results 1 to 3 of 3
  1. #1
    catluvr is offline Advanced Beginner
    Windows 10 Office 365
    Join Date
    Mar 2018
    Location
    Kansas
    Posts
    87

    Question Find (not replace) spaces in a text field

    I've searched for the answer, but I keep getting the wrong wording.



    I want to FIND records that have a blank space in a particular field, not replace anything.

    I am importing records from an Excel file. The records are the results of registration using an online form. The form asks for the first and last names separately, but several times, parents have filled in the first name field with the full name and the last name field with the last name. (I don't know why they don't realize they did that after they type the last name again, but that's a whole other thing!)

    What I would like to do is run a query that returns records where the first name has a space. I don't want to replace anything using the query because many times a legitimate first name has a space … Amanda Lynne or Mary Grace.

    All I can find is references to replacing the space " " with nothing "".

    Is there a way to do what I want?

    Thanks!

    Susie
    Kansas

  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,825
    SELECT * FROM table WHERE InStr(fieldname, " ") > 0;

    or

    SELECT * FROM table WHERE fieldname LIKE "* *";
    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
    catluvr is offline Advanced Beginner
    Windows 10 Office 365
    Join Date
    Mar 2018
    Location
    Kansas
    Posts
    87
    June7,

    OF COURSE! Why did I think of that! So simple!

    And works perfectly. Thank you!

    Susie
    Kansas

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

Similar Threads

  1. Replies: 2
    Last Post: 04-26-2020, 02:01 AM
  2. VBA to find/replace text in word document
    By Goodge12 in forum Programming
    Replies: 1
    Last Post: 07-16-2014, 01:23 PM
  3. Replies: 2
    Last Post: 07-09-2014, 06:41 PM
  4. Replace Carriage Returns with Spaces
    By chitan in forum Queries
    Replies: 1
    Last Post: 12-15-2011, 11:14 AM
  5. Find Spaces in Field
    By stottle in forum Queries
    Replies: 6
    Last Post: 08-17-2009, 02:02 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