filter with wildcard

ECEK

Registered User.
Local time
Today, 16:17
Joined
Dec 19, 2012
Messages
717
Hi All
I want to capture all variables that begin with the word "Pre"

DoCmd.ApplyFilter , "Status = 'Pre*'"

I'm a bit confused by & and '''''''' and """""""""
Is there a go to place to learn the syntax?

Thanks in advance
 
If building any sql or where clause wrap in single qoutes.
No need to ever do '''''''' and """""""". Confusing and waste of time.
 
Thanks Doc. I'm still struggling though!!!
 
I'm confused by the use of single and double quotes. Could somebody please help me with my syntax.
Thanks
 
Maybe a bunch of examples will help. See where you are confused

Code:
Public Sub Test2()
  'you wrap a string in double quotes to make a string
  'You wrap a literal in a string in single quotes
  Dim str As String
  str = "Hello world"
  Debug.Print str
  str = "Hello 'Happy' world"
  Debug.Print str
  Debug.Print str & " '"; Date & "'"
  Debug.Print str
  Debug.Print "'ABC'"
  Debug.Print """ABC"""
  Debug.Print """" & "ABC" & """"
  Debug.Print str & " and new string 'somethinginSingleQuotes'" & """ somethingindoublequotes """
End Sub

Code:
Hello world
Hello 'Happy' world
Hello 'Happy' world '1/24/2019'
Hello 'Happy' world
'ABC'
"ABC"
"ABC"
Hello 'Happy' world and new string 'somethinginSingleQuotes'" somethingindoublequotes "
 
Figured it out:

DoCmd.ApplyFilter , "Status Like 'Pre*' "
 

Users who are viewing this thread

Back
Top Bottom