Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


update syntax Access

Posted on 2012-08-28
Medium Priority
Last Modified: 2012-08-28
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?
Question by:seamus9909
1 Comment
LVL 77

Accepted Solution

peter57r earned 2000 total points
ID: 38342033
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 & "'"

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question