Compile error: method or data memember not found

lovedieer

Registered User.
Local time
Today, 11:12
Joined
Nov 4, 2009
Messages
28
I try to make a audittrail function to monitor users edit the records. I used a template in the website and the code is
Code:
Private Sub ProjectName_BeforeUpdate(Cancel As Integer)
    WriteAuditUpdate txtTableName, Me.ID, "ProjectName", Me.ProjectName.OldValue, Me.ProjectName.Value
End Sub

however, when I try to debug-->compile , i got this error message: Compile Error: Method or data memember not found. and it highlited my ProjectName part. BUt I do have the variable name ProjectName in my form and table. It also happend to some other variables, but not all the variables. Can somebody help me to figure out what cause this error.

Many thanks.
 
try changing your ProjectName field on your form to txtProjectName. and reference this in your code.
 
try changing your ProjectName field on your form to txtProjectName. and reference this in your code.

Thank you very much. it's working now.

But I got a new problem, after i change the records in my form, some variable changes can be caputured in my audit trail table, but some cannot be captured.

for example, I have two variables, one is txtProjectName, one is RequestDate, the change for the projectname can be captured and saved in the audit table, but the change for the request date did not captured in the audit table.
 
Thank you very much. it's working now.

But I got a new problem, after i change the records in my form, some variable changes can be caputured in my audit trail table, but some cannot be captured.

for example, I have two variables, one is txtProjectName, one is RequestDate, the change for the projectname can be captured and saved in the audit table, but the change for the request date did not captured in the audit table.

try doing the same thing of renaming it. The problem is that your underlying table has the name as well as the control. Access by default looks at the recordsource first then the control. It's good form to rename your controls.
 

Users who are viewing this thread

Back
Top Bottom