Syntax Error (1 Viewer)

gojets1721

Registered User.
Local time
Today, 11:36
Joined
Jun 11, 2019
Messages
430
I'm getting a 3075 syntax error on this line. I think I'm missing a quotation or apostrophe somewhere but can't figure it out.

Here's the specific line of code. I'm trying to get a field to equal the value of a combobox

Code:
strTemplate = "TemplateName = '" & Me.comboTemplate

I'm getting a syntax error showing this:
'Template Name = 'Example'

Any suggestions
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 11:36
Joined
Aug 30, 2003
Messages
36,126
You aren't closing the single quote (presuming it's needed):

strTemplate = "TemplateName = '" & Me.comboTemplate & "'"
 

GaP42

Active member
Local time
Tomorrow, 04:36
Joined
Apr 27, 2020
Messages
338
Just in case, you may not be consistent with the type of data: TemplateName looks like string. A combo record source often uses the ID of the records from the recordsource (altho the ID might not be what is being displayed to the user).
 

Users who are viewing this thread

Top Bottom