Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Comparison Operators.

Status
Not open for further replies.

vicktown

Technical User
Jul 13, 2004
27
CA
Syntax error (missing operator) in query expresion '[tblLCDAssess].[Short Name] = Bees Test'


I keep getting this error when i run a form that uses the below line of programming. The I assume i am misusing the comparison operator for matching 2 strings but i dont know what else to do. Ive checked all of the sources and they are all fine. I have narrowed it down to a coding problem. Any ideas?


[tblLCDAssess].[Short Name] = " & Me.RecordsetClone![Short Title] & ";
 
Looks like it's seeing Bees Test as two variables.

Try using this line:

[tblLCDAssess].[Short Name] = "'" & Me.RecordsetClone![Short Title] & "'"

- RoppeTech
 
Give us the WHOLE line of code and we might stand a chance.

That error is usually a delimitor problem of a variable stuck inside a literal string.







G LS
spsinkNOJUNK@yahoo.co.uk
Remove the NOJUNK to use.
 
This is the entire line:

strFind = "SELECT DISTINCTROW [tblAssessments].[AssessID] FROM [tblAssessments] WHERE [tblAssessments].[LegislationKey] = " & Me.RecordsetClone!LegislationID & " ;"

ALso i have no clue what this means:

delimitor problem of a variable stuck inside a literal string

Please explain
 
How this line:
strFind = "SELECT DISTINCTROW [tblAssessments].[AssessID] FROM [tblAssessments] WHERE [tblAssessments].[LegislationKey] = " & Me.RecordsetClone!LegislationID & " ;"
can generate this error ?
Syntax error (missing operator) in query expresion '[tblLCDAssess].[Short Name] = Bees Test'

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Oops Typo problem

delimitor problem OR a variable stuck inside a literal string



As PHV says - we can see no relation between the original problem and the apparently NEW chunk of code.

Apart from a lot of unnecessary typing there doesn't seem too much wrong with what you've just posted, IFF LegislationId returns a NUMBER.

If it returns the text Bees Test then you do have problems.

Try
strFind = "SELECT DISTINCTROW AssessID FROM tblAssessments WHERE LegislationKey = '" & Me.RecordsetClone!LegislationID & "' ;"



'ope-that-'elps.








G LS
spsinkNOJUNK@yahoo.co.uk
Remove the NOJUNK to use.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top