How do I modify Auditing Code to deal with Sub-Forms and Data Relationships? (1 Viewer)

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 21:27
Joined
May 7, 2009
Messages
19,175
add another condition
Code:
                If ctl.Tag = "Audit" Or ctl.Tag = "ListAudit" Then
                    If ((Nz(ctl.value) <> Nz(ctl.OldValue)) Or ctl.Tag = "ListAudit") And Nz(ctl.OldValue, "") <> "" Then
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 09:27
Joined
Feb 19, 2002
Messages
42,981
Just to be clear, whether you use DAO or ADO, you still need to dim the objects and arnel's code doesn't do that.

Dim rst AS DAO.Recordset

ALWAYS disambiguate DAO/ADO objects to prevent a problem should someone else ever add a reference to the "other" library.

There was a push to ADO almost 20 years ago. It was short lived (one version) and caused a great deal of confusion. MS never changed Access form recordsets from DAO to ADO and eventually, MS came to their senses and went back to making DAO the default library since making ADO the default library was causing too much of a problem. If your BE is NOT Jet or ACE, it MAY be faster to use ADO for certain operations but that is not guaranteed.
 

Users who are viewing this thread

Top Bottom