Results 1 to 3 of 3

Thread: Saving Data

  1. #1
    Join Date
    Nov 2009

    Question Unanswered: Saving Data

    Hi all,

    I would like to ask if it is possible to prevent the auto-saving of data when the user has finished inputting into a record of data (Access 2003)? And wait till the user clicks on the "Save Changes" button which will then prompts the user with Yes/No Dialogbox, if "Yes", data will be committed into DB, else changes will be undone. Thanks!


  2. #2
    Join Date
    Oct 2009
    in terms of a normal database the answer is no.

    in terms of anything can be done with software the answer is yes. but it can be very tricky depending on your situation...if they've changed a bunch of different fields - how does that get unchanged back to the original data??

    it is more simple if they are entering new data only - and then it is an all or nothing decision...

    but it is custom code - so if you are not comfortable with vb / sql such as writing and triggering an insert query - - then this may not be something you want to do.

    so this isn't a vanilla option easily accommodated by a casual Access user - so that's why my first answer was no. I know that many online purchases have this style so that it seems common place but in databases it is not.

  3. #3
    Join Date
    Dec 2004
    Madison, WI
    Try the me.undo command. You can undo changes on a form.

    If that doesn't work, write a simple delete function:


    Function DelRecord(RecID as variant)
    dim rs as adodb.recordset
    set rs = new adodb.recordset
    dim strSQL as strin
    strSQL = "Select * from MyDataTable where RecordID = " & RecID & "" strSQL, currentproject.connection, adopendynamic, adlockoptimistic
    set rs = nothing
    End Function

    and then call it....

    Call DelRecord(MyIDField)

    Note: You may also want to add confirmation using a msgbox.

    Or you can design a delete button using the button design wizard and then utilize the code in that which deletes the current record.
    Last edited by pkstormy; 11-09-09 at 23:16.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts