Updating a record on a bound continuous form

Posted on 2012-08-12
Last Modified: 2012-08-13
I have a continuous form that is bound to a temporary table. When I open the form, in the on_load event, I populate this table with various SQL calls and then at the end of he on_load event, I do a Me.Requery and Me.Refresh. This puts the table contents on the screen in my continuous form. However, I am trying to figure out how to update the record when I change data. So far, I see that if I make my data changes and then move to another record on the form, then the updates work, but if I only have one record showing, there is no other record to go to and how do I get the data to update? (I have the AllowAdditions set to false, since I don't want users to be able to add records through this form.) I have added a button to the record called Update, but I am not sure what code to put in it to update the table?
Question by:Rich
    LVL 29

    Accepted Solution

    In the OnClick event of your Update button, try this:
    Dirty = False.

    Also you don't need to have both requery and refresh in your load event.  A requery would suffice.
    LVL 77

    Expert Comment

    Also note that if you make any change to data in a bound form, the record will be updated no matter how you move away from that record- so moving to a different record saves the current chnages (as you already know) but also closing the form, closing the application or closing Access will also cause the current record to be saved.
    So unless you actively undo the changes they will be saved.

    Author Closing Comment

    Thank you, that did it.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Suggested Solutions

    This isn't a frequent question on EE. I must have seen it three or four times (among several thousand questions). However, I use this trick quite often, most frequently as a delayed Current event. A form does not expose it's calculation dependenc…
    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 utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
    In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

    754 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

    23 Experts available now in Live!

    Get 1:1 Help Now