update syntax Access

So I have a form that i want to add some code to update a field in the corresponding record in tblClaims.

The field is StatusID and the the key is InvoiceID.

so update staus Id "5" where InvoiceID = me.invoiceId

Can someone show me the correct syntax to use?
Who is Participating?
dim strsql
strsql = "Update tblclaims set statusid = 5 where invoiceID = " & me.invoiceid
currentdb.execute strsql, dbfailonerror

This assumes invoiceid is a number.
If it is text change that line to...

strsql = "Update tblclaims set statusid = 5 where invoiceID = '" & me.invoiceid & "'"
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.