Syntax Error

  • Thread starter Thread starter Cuda
  • Start date Start date
C

Cuda

I'm receiving a "Syntax error in string in query expression
'(ProjectNo=MC-6100") for the following:

Dim stDocName As String
Dim strCurrent As String
strCurrent = Me!ProjectNo & Chr(34)

stDocName = "Project Information"
DoCmd.OpenReport stDocName, acPreview, WhereCondition:="ProjectNo=" &
strCurrent

The project number is MC-6100
 
Cuda said:
I'm receiving a "Syntax error in string in query expression
'(ProjectNo=MC-6100") for the following:

Dim stDocName As String
Dim strCurrent As String
strCurrent = Me!ProjectNo & Chr(34)

stDocName = "Project Information"
DoCmd.OpenReport stDocName, acPreview, WhereCondition:="ProjectNo=" &
strCurrent

The project number is MC-6100

You only have one Chr(34) in strCurrent.

Try this:

strCurrent = "'" & Me!ProjectNo & "'"

Tom Lake
 
Back
Top