Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.
One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.
Sub AuditChanges(IDField As String) On Error GoTo AuditChanges_Err Dim cnn As ADODB.Connection Dim rst As ADODB.Recordset Dim ctl As Control Dim datTimeCheck As Date Dim strUserID As String Set cnn = CurrentProject.Connection Set rst = New ADODB.Recordset rst.Open "SELECT * FROM tblAuditTrail", cnn, adOpenDynamic, adLockOptimistic datTimeCheck = Now() strUserID = Environ("USERNAME") For Each ctl In Screen.ActiveForm.Controls If ctl.Tag = "Audit" Then If Nz(ctl.Value) <> Nz(ctl.OldValue) Then With rst .AddNew ![DateTime] = datTimeCheck ![UserName] = Environ("USERNAME") ![FormName] = Screen.ActiveForm.Name ![RecordID] = Screen.ActiveForm.Controls(IDField).Value ![FieldName] = ctl.ControlSource ![OldValue] = ctl.OldValue ![NewValue] = ctl.Value .Update End With End If End If Next ctl AuditChanges_Exit: On Error Resume Next rst.Close cnn.Close Set rst = Nothing Set cnn = Nothing Exit Sub AuditChanges_Err: MsgBox Err.Description, vbCritical, "ERROR!" Resume AuditChanges_Exit End Sub
If Status = acDeleteOK Then Call AuditChanges("RecordID", "DELETE")
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
|find first method with 2 variable search criteria||10||41|
|usage of ms/excell 3d maps in ms/access 2016||6||36|
|SQL 'Fuzzy' (any part of string matches) match on passed text string in SPROC.||14||48|
|Excel graph in access report||1||26|
Join the community of 500,000 technology professionals and ask your questions.