lacampeona
Registered User.
- Local time
- Today, 15:59
- Joined
- Dec 28, 2015
- Messages
- 392
Hello experts
I start to get some error.
My code in the module? Windows updates?
I have to say that everythink was perfect and now 3 days ago error error errror... i try to export all the database in new database and i still get the error.
I am so sad......will i have to do all from the begining?
thanks in advance
when i click debug
i get this yellow marking
here is my module: line 52 :
' Skip Updates field
If ctlData.Name = "Updates" Then GoTo NextCtl
I start to get some error.
Run-time error 5 - Invalid procedure call or argument
Does anybody know what could be the reason?My code in the module? Windows updates?
I have to say that everythink was perfect and now 3 days ago error error errror... i try to export all the database in new database and i still get the error.
I am so sad......will i have to do all from the begining?
thanks in advance
when i click debug
i get this yellow marking
here is my module: line 52 :
' Skip Updates field
If ctlData.Name = "Updates" Then GoTo NextCtl
Code:
Option Compare Database
Public Function AuditData2()
' Comments : This function is used to provide an audit trail of all changes to a record
' : entered on a secured form. After adding a locked memo field called 'Updates'
' : on the source form, add a reference to the Before Update event to this function.
' Requirement: A bound memo field named 'Updates' must exist on the active form
' Parameters : None
' Returns : Appends Audit Trail data as a string to the memo field on the active form
' Created By : Ofni Systems Inc.
' Modified : 04/07/01
' --------------------------------------------------------
Dim frmActive As Form
Dim ctlData As Control
Dim strEntry As String
Dim User As String
Dim Kdo As String
Kdo = TempVars!UserName
User = CreateObject("wscript.network").ComputerName
Set frmActive = Screen.ActiveForm
'Set date and current user if form has been updated.
frmActive!Updates = frmActive!Updates & Chr(13) & Chr(10) & _
"----------------------------------------------------------------------------------------------" & Chr(13) & Chr(10) & _
"Changes made on " & Date & " " & Time & " by " & Kdo & ";"
'Determine who, when and where
strEntry = " by " & Kdo & " on " & Now
' If new record, record it in audit trail and exit sub
If frmActive.NewRecord = True Then
frmActive!Updates = frmActive!Updates & "New Record Added" & strEntry
'Uncomment the next line if you do not want to record the details of the initial entry
'Exit Function
End If
'Check each data entry control for change and record
For Each ctlData In frmActive.Controls
' Only check data entry type controls
Select Case ctlData.ControlType
Case acTextBox, acComboBox, acCheckBox, acOptionButton
' Skip Updates field
If ctlData.Name = "Updates" Then GoTo NextCtl
'Skip unbound controls (3 is ControlSource)
Select Case IsNull(ctlData.Value)
'Check for deleted data
Case True
If Not IsNull(ctlData.OldValue) Then
frmActive!Updates = frmActive!Updates & Chr(13) & Chr(10) & " " & ctlData.Name & " Data Deleted: Old value was '" & ctlData.OldValue & "'" & strEntry
End If
'Check for new or changed data
Case False
If IsNull(ctlData.OldValue) And Not IsNull(ctlData.Value) Then
frmActive!Updates = frmActive!Updates & Chr(13) & Chr(10) & " " & ctlData.Name & " Data Added: " & ctlData.Value & strEntry
'If control had previous value, record previous value
ElseIf ctlData.Value <> ctlData.OldValue Then
frmActive!Updates = frmActive!Updates & Chr(13) & Chr(10) & " " & ctlData.Name & " changed from '" & ctlData.OldValue & "' to '" & ctlData.Value & "'" & strEntry
End If
End Select
End Select
NextCtl:
Next ctlData
End Function