Results 1 to 2 of 2

Thread: .filter statement on name with apostrophy

Threaded View

  1. #1

    Thread Starter
    Member
    Join Date
    Dec 2011
    Posts
    32

    .filter statement on name with apostrophy

    I have the following filter statement to narrow down to the currently logged in user.

    Code:
    Forms![Incidents List].FilterOn = False
        Forms![Incidents List].RecordSource = "Qry_Incidents"
        Forms![Incidents List].Filter = "([staff_name] like '" & username & "' or [staff_supervisor] like '" & username & "')"
        Forms![Incidents List].FilterOn = True
    The Staff_name and Staff_supervisor fields have some names with ' in the name like O'Brien.

    I get a syntax error when it encounters one.

    How can I effectively search a name like this?

    Thank you,

    Steve Hathaway
    Last edited by shathaway; Mar 7th, 2016 at 01:26 PM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width