Error 3075

  • Thread starter Frankie via AccessMonster.com
  • Start date
F

Frankie via AccessMonster.com

I have Error 3075 (missing operator on [NumProspect]) in the following code
put on a form After Update Event :
If Not IsNull(Me!NomClient) Then
CurrentDb.Execute "UPDATE tblSecteurProspects SET " _
& "Statut = 'Client'," _
& "CodeClient = " & Chr$(34) & Me!CodeClient & Chr$(34) & " WHERE
NumProspect = " _
& Me!NumProspect, dbFailOnError
End If
Me!NumProspect (on Form) is a long Integer as well as NumProspect (on
tblSecteurProspects).
I don't get it since it's been working fine so far.
Can someone please help me??
Thanks in advance
Frankie
Access 2003
 
G

Guest

Using chr(34) means that you are trying to put "CodeClient" into the record.
Not sure why you want it with quotes around. If this is what you want then
you are missing the single quotes around it (just like around Statut) to
signify string
& "CodeClient = '" & Chr$(34) & Me!CodeClient & Chr$(34) & "' WHERE
 
F

Frankie via AccessMonster.com

Thanks for your answer, Dennis.
CodeClient is a text field which is why I use Chr$(34).
I am a little confused with what you propose :
& "CodeClient = '" & Chr$(34) & Me!CodeClient & Chr$(34) & "' WHERE
Because It doesn't work, I still get the same message.
Any other ideas?
 
G

Guest

Single quotes signify a string, so take out the chr$(34)'s leaving the single
quotes around your Me!CodeClient variable.

"CodeClient = '" & Me!CodeClient & "' WHERE
 
D

Douglas J. Steele

Try assign the SQL to a variable and writing the value of the variable to
the Immediate Window using Debug.Print.

See whether the SQL looks right to you. If it does, does it run?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Error 3075 2
Insert Code Not Working 2
Code Error 8
Runtime 3075 2
lost in error 3075 8
returned value poblem in sql update query 4
SQL Coding Question 4
Incorrect syntax for dynamic Update query 1

Top