Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Function AuditNYC (strAction as String, strForm as String, strID as String, strSQL as String) as Boolean
Dim dbs as DAO.Database, rst as DAO.RecordSet
Set dbs = CurrentDB()
Set rst = dbs.OpenRecordSet("YourAuditTable")
With rst
.AddNew
!User = CurrentUser
!AuditDate = Now()
!FormName = strForm
!Action = strAction
!UniqueID = strID
!RecordSource = strSQL
.Update
End With
rst.close
dbs.close
AuditNYC = True
End Fucntion
'Code in AfterUpdate record event, not field event
Dim strAction as String, strForm as String, strID as String, strSQL as String
strAction = "AddNew"
strForm = Me.Form.Name
strSQL = Me.RecordSource
strID = Format(Me.YourID, "0")
If Not AuditNYC (strAction, strForm, strID, strSQL)
MsgBox "Audit failed"
End If