update syntax Access

Posted on 2012-08-28
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

    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

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    The first two articles in this short series — Using a Criteria Form to Filter Records ( and Building a Custom Filter ( — discuss in some detail how a form can be…
    I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
    Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
    In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

    745 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

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now