Run time error 3075 - help please

  • Thread starter Thread starter Phil Hood
  • Start date Start date
P

Phil Hood

When I run the following code (bottom), I get an error:

-------------------------
Run time error 3075
Syntax error (missing operator) in query expression
'((([ResultDescription.ResultDesc]) = First Place))'

Forms![Heat]![Results subform].Form![Result] contains a
string i.e. First Place
-------------------------

I can't work out what is wrong. Help please!


Dim strQuerySQL6 As String
Dim x As String

Set dbsCurrent = CurrentDb

strQuerySQL6 = "SELECT ResultDescription.* FROM
ResultDescription WHERE ((([ResultDescription.ResultDesc])
= " & Forms![Heat]![Results subform].Form![Result] & "));"

Set rstPoints = dbsCurrent.OpenRecordset(strQuerySQL6)
 
Strings must be enclosed in quotes. Change this line to:
= '" & Forms![Heat]![Results subform].Form![Result] & "'));"
 
Thanks, it works now.

-----Original Message-----
Strings must be enclosed in quotes. Change this line to:
= '" & Forms![Heat]![Results subform].Form![Result] & "'));"


--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
(e-mail address removed)
www.pcdatasheet.com



Phil Hood said:
When I run the following code (bottom), I get an error:

-------------------------
Run time error 3075
Syntax error (missing operator) in query expression
'((([ResultDescription.ResultDesc]) = First Place))'

Forms![Heat]![Results subform].Form![Result] contains a
string i.e. First Place
-------------------------

I can't work out what is wrong. Help please!


Dim strQuerySQL6 As String
Dim x As String

Set dbsCurrent = CurrentDb

strQuerySQL6 = "SELECT ResultDescription.* FROM
ResultDescription WHERE ((([ResultDescription.ResultDesc])
= " & Forms![Heat]![Results subform].Form![Result] & "));"

Set rstPoints = dbsCurrent.OpenRecordset(strQuerySQL6)


.
 
Back
Top