• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1553
  • Last Modified:

Access 2003 - audit trail. tracking changed or deleted records to a table.

Access 2003.  Re : Microsoft's article No. 197592 re How to create an audit trail of record changes in a form in Access 2000.
I tried this code.  And in No.7 of the steps, I inserted in the BeforeUpdate the syntax =AuditTrail().
But I get a Compile Error which says : Expected; line No or Label or Statement or End of Statement

This question is in 2 parts.  One is to check out the mentioned  Microsoft suggested solution and the 2nd part is finding a simple solution to capture any records that were changed in a Form.  the changed records could be stored in a separate table.  

Can someone please check the Microsoft suggested solution  out and let me know how to implement this.

What I did:  Following the steps, I created a field in the Table which was to be audited.  The field was named Updates and is a Memo field.  Then in the Form's BeforeUpdate event of the form, I typed =AuditTrail().  I have a command button that will delete a record and when I clicked on the command button  I got the  error message. Compile Error which says : Expected; line No or Label or Statement or End of Statement

I want something simple that would work.  I tried Allen Browne's code but it did not work either and I appreciate his response that it would be impossible or not feasible to support Free stuff.  So I am abandoning his solution and am trying for something that would be simple.

  I just want to capture in a separate table any records that were changed or deleted when viewed through a form.  
Thanks.
0
jegajothy
Asked:
jegajothy
1 Solution
 
mbizupCommented:
>  =AuditTrail()
Is that the entire syntax you are using for this line of code?  Is it in the actual VBA code, or just in the property sheet?

If it is in the VBA Code...

Hazarding a guess, either drop the = sign and parentheses:

AuditTrail

or assign it to some value

Dim SomeValue as Variant
SomeValue = AUditTrail()
0
 
Rey Obrero (Capricorn1)Commented:
post the codes that you are *using*
0
 
Rey Obrero (Capricorn1)Commented:
per m$   =AuditTrail()  should be in the property sheet BeforeUpdate event
0
Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

 
mbizupCommented:
>One is to check out the mentioned  Microsoft suggested solution and the 2nd part is finding a simple solution to capture any records that were changed in a Form.  the changed records could be stored in a separate table....

These are seperate topics, and should be posted as seperate EE questions.
0
 
jegajothyAuthor Commented:
Please have a look at the Microsoft article and offer the solution.  Thanks.
0
 
harfangCommented:
This is the code jegajothy is using:

How to create an audit trail of record changes in a form in Access 2000
http://support.microsoft.com/kb/197592

The function AuditTrail() compiles fine as is (without any additional libraries) and will effectively write the audit information in the field Updates.

Possible problems:
You didn't follow this to the letter:

    4. Save the Module as Module1 and close the Visual Basic Editor.

If you named your module 'AuditTrail', that would conflict with the function name.

You have another problem in your "delete" command button. Does your code compile? From VB, use (Debug | Compile <project name>)

(°v°)
0
 
Rey Obrero (Capricorn1)Commented:
jegajothy,
we know about the m$ link.

what we want to see  is the codes you are using.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now