I have a form with a button to open another form passing a string criteria to retrieve a specific record.
But…
The Company name has a single quote in the name. This of course gives and error.
Syntax error ( missing operator in query expression).
The Company name has an apostrophe in it ---> Veteran's
I am editing the string in the Command window without success.
[Project Number] = '080344' And Service = 'AM' And Number = '1' and [Building Name] ='''James A. Haley Veteran's Hospital'''
Any ideas
Here is my code
DougP
< I love mine
But…
The Company name has a single quote in the name. This of course gives and error.
Syntax error ( missing operator in query expression).
The Company name has an apostrophe in it ---> Veteran's
I am editing the string in the Command window without success.
[Project Number] = '080344' And Service = 'AM' And Number = '1' and [Building Name] ='''James A. Haley Veteran's Hospital'''
Any ideas
Here is my code
Code:
Dim stDocName As String
Dim stLinkCriteria As String
stLinkCriteria = "[Project Number] = '" & Me![Project Number] & "' And Service = '" & _
"" & Me![Service] & "' And Number = '" & Me!Number & "' and [Building Name] =" & _
"" & Chr(39) & Me![Building Name] & Chr(39)
stDocName = "frmPersonnelAirSamplingLog"
DoCmd.OpenForm stDocName, , , stLinkCriteria
DougP
![[r2d2] [r2d2] [r2d2]](/data/assets/smilies/r2d2.gif)