Update query in access VBA

Mukhmoor

Registered User.
Local time
Yesterday, 16:44
Joined
Apr 30, 2011
Messages
13
I m using access 2007. I want to use following update query in access vba but its giving error. Query is:
Docmd.RunSQL ("UPDATE property set property.status="& "'empty'" & " Where property.propertyid="& me.cmbpropertyid.value &"")

It gives the following error:
Missing ),], or item in query expression '(property.propertyid=4'.

Can anyone help me? Thnx......
 
Hello and Welcome Mukmoor :)

Docmd.RunSQL ("UPDATE property set property.status=" & "'empty'" & " Where property.propertyid = " & me.cmbpropertyid & ")

Also please don't use the reserve words like property as your fields names.
 
Thnx a lot khalid.....now it works fine:) an extra"(" without closing ")" was problem.
 

Users who are viewing this thread

Back
Top Bottom