Results 1 to 4 of 4
  1. #1
    Access_Novice is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Sep 2013
    Posts
    265

    What is the difference between the onChange and onDirty events?


    Both of these are triggered as soon as you change the contents of a text box. Some website mentioned that onDirty is triggered when a form changes. So I added an option group to test that. But that option group didn't have an onDirty event.

    So when would you use onChange? How about onEvent?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    OnChange is an event of data controls. It executes with every character typed into the control.

    OnDirty is an event of form. It executes with any data change in any control.

    I have never used either of them.

    I have used the form Dirty property.
    If [Form_DataSoilsAgg1].Dirty Then [Form_DataSoilsAgg1].Dirty = False
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    I rarely use either. The change event fires with every keystroke. The dirty event fires as soon as data is changed. I typically use the before update event for validation and the after update event for handling what was entered. The appropriate event for you depends on exactly what you're trying to achieve.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  4. #4
    Access_Novice is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Sep 2013
    Posts
    265
    Quote Originally Posted by pbaldy View Post
    I rarely use either. The change event fires with every keystroke. The dirty event fires as soon as data is changed. I typically use the before update event for validation and the after update event for handling what was entered. The appropriate event for you depends on exactly what you're trying to achieve.
    Ok. Thank you all.

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

Similar Threads

  1. Replies: 3
    Last Post: 05-23-2013, 05:30 PM
  2. OnDirty Cancel
    By gg80 in forum Programming
    Replies: 10
    Last Post: 05-18-2013, 05:03 PM
  3. onDirty Code
    By tariq1 in forum Programming
    Replies: 2
    Last Post: 08-11-2012, 01:27 PM
  4. Running a query OnChange
    By zb134 in forum Access
    Replies: 2
    Last Post: 05-18-2012, 04:39 PM
  5. AfterUpdate/OnChange not working
    By ccordner in forum Forms
    Replies: 1
    Last Post: 02-08-2012, 11:58 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