Results 1 to 6 of 6
  1. #1
    lonesoac0 is offline Advanced Beginner
    Windows 7 32bit Access 2013
    Join Date
    Aug 2014
    Posts
    36

    On Dirty Propery

    Hello all,



    The end goal of what I am trying to do is when someone edits a field in one of my forms then a new record is created with the updated information. As a result, there are now two records one with the original information and a new record with the updated information. I am thinking that the On Dirty has something to play into this, but I cannot get it to work appropriately. I have tried Before Update on a field and then a Macro with the message box of Message: =[Forms]![Testing]![Field1].[OnDirty] but that just makes a blank Message.

    Am I on the right track?

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    I wouldn't create a second record in the same table, but I don't know your situation. Search on "audit trail" to see a couple of other methods. To your question, you can use the before update event of the form. It will only fire if the user changes anything.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    lonesoac0 is offline Advanced Beginner
    Windows 7 32bit Access 2013
    Join Date
    Aug 2014
    Posts
    36
    I would like to give you a basic back story and maybe you can help me decide on which direction to go with either Audit trail or copying records. I am creating an eye examination application for a non-profit clinic in a third world country. My client wants to be able to adjust just one or two things from the last examination to cut down on examination time and to build up a history for her clients. I just thought that the copying of 95% of the same record would provide a little bit more reporting robustness. Now that I think about it, (retorical question to self) "How would I track either one? With the same information of userID. The only difference would be that the change would be either on two records or one depending on the method chosen. Not to mention storage efficiency would go way up with audit logs too." Ok, I am sold on Audit Trail. Thank you pbaldy.

  4. #4
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    Just a note -

    The property name is just .Dirty. On Dirty is the Event that occurs as soon as you make any change to a record in a bound form, i.e. as soon as you type or delete anything, or select from a combo box, etc.

  5. #5
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Quote Originally Posted by lonesoac0 View Post
    Thank you pbaldy.
    Happy to help!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  6. #6
    Micron is offline Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    Umm, maybe not.
    OnDirty is a property https://support.office.com/en-us/art...3-dd01d0d14154
    .Dirty is an event https://msdn.microsoft.com/en-us/lib.../ff835655.aspx

    If you want an audit trail, yes you'd repeat some records, but not necessarily all fields. Patient info should be in one table, visit info in another. Each visit would be a record that you'd relate to the patient via a form bound to a query on those two (or more) tables. However, you would not repeat the patient info. Sounds like you might want to check out database normalization also.

    BTW, most likely your message box didn't work because you're trying to pass a property to it. Message boxes are for text only (or anything that can be represented as text).
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

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

Similar Threads

  1. me.dirty
    By slimjen in forum Forms
    Replies: 2
    Last Post: 03-28-2013, 01:51 PM
  2. Dirty problem with numbers
    By gg80 in forum Programming
    Replies: 11
    Last Post: 02-07-2013, 01:14 PM
  3. Me.Dirty not catching
    By Ashe in forum Forms
    Replies: 4
    Last Post: 10-27-2011, 11:30 AM
  4. On Dirty fires but Me.Dirty = False (v2010)
    By Rod in forum Programming
    Replies: 5
    Last Post: 07-30-2011, 08:42 PM
  5. Dirty
    By JEPEDEWE in forum Programming
    Replies: 1
    Last Post: 11-13-2010, 04:50 PM

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