Results 1 to 6 of 6
  1. #1
    Join Date
    Aug 2008
    Posts
    3

    Forms: Not immediate change of database

    Hi,

    I have textfield in a form, which retrieves the data from a database. How can I specify, whether the corresponding field in the database should be updated immediately, or only if evoke by an event. (I know, how to program the event which changes the entries in the database). My problem is that I don't know, how to specify, that the change should or should not take place immediately.



    Thank you very much for your help!
    f

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    If your form is bound to a query/table then the update *will* take place when you close the form or move to another record unless you stop it. I'm not sure what your question is. Are you talking about using transactions?

  3. #3
    Join Date
    Aug 2008
    Posts
    3
    Quote Originally Posted by RuralGuy View Post
    If your form is bound to a query/table then the update *will* take place when you close the form or move to another record unless you stop it. I'm not sure what your question is. Are you talking about using transactions?
    Thanks a lot for your reply.
    Actually, I was looking exatly for the command to stop the database from updating when I move to another record.
    Ultimately, I want to have a MsgBox saying "Do you want to keep these changes?" If the user says "yes", I guess, then I don't have to do anything, but if he says "no", what command should I use?

    Thanks a lot!

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Your code goes in the BeforeUpdate event of the *FORM* and you use Me.UnDo to revert any changes. You would also set Cancel = True to cancel any update.

  5. #5
    Join Date
    Aug 2008
    Posts
    3
    Thanks a lot! This exactly, what I was looking for!

  6. #6
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    You're very welcome. Glad I could help.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 06-08-2010, 12:08 PM
  2. Change Date Into Number
    By greenbag in forum Queries
    Replies: 0
    Last Post: 11-14-2008, 04:43 PM
  3. Change of label size
    By Zoroxeus in forum Programming
    Replies: 0
    Last Post: 06-11-2007, 08:18 AM
  4. Replies: 10
    Last Post: 11-13-2006, 02:07 AM
  5. Change the colour of a form background
    By r_e_v_a_n_s in forum Forms
    Replies: 0
    Last Post: 11-15-2005, 03:39 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums