ColumnHistory

odrap

Registered User.
Local time
Today, 18:27
Joined
Dec 16, 2008
Messages
156
Recently i got knowledge of the fact that in Access2007, a new property was added for fields of type memo, namely 'AppendOnly'.
Because i need a way to get informed about the date an extra info concerning a client was added, i thought that the use of this property could be the solution. So i changed the property 'appendonly ' of the field 'info' of type memo in my table tblClients to 'true'.
On my form frmClients I have a button when clicked, popups a small form with a control that displays the content of the memofield of the current client. this control is bounded to the field 'info' in my table 'tblClients'
When i right click on this control 'n this popup form i can choose for displaying the history of changes made to this field. But in practice when i right click on this control i get the message : 'Can't find the field'. What am i doing wrong?
 
did you follow the example from access help?

Access Developer Reference
Application.ColumnHistory Method
Gets the history of values that have been stored in a Memo field.
Version Information
Version Added: Access 2007

Syntax

expression.ColumnHistory(TableName, ColumnName, queryString)

expression A variable that represents an Application object.

Parameters

Name Required/Optional Data Type Description
TableName Required String The name of the table that contains the Append Only field.
ColumnName Required String The name of the field to display the history for.
queryString Required String A String used to locate the record. It is like the WHERE clause in an SQL statement, but without the word WHERE.

Return Value
String

Remarks


A Memo field's AppendOnly property must be set to True in order for Access to store the change history for the field.



Example


The following example prints the salary history of employee number 147 to the Immediate window.

Visual Basic for Applications
Code:
Sub colhist()
    Dim sHistory As String
    
    sHistory = Application.ColumnHistory("Employees", "Salary", "ID=147")
    Debug.Print sHistory
End Sub
© 2006 Microsoft Corporation. All rights reserved.

edit: you could change the Debug.Print to a Msgbox if you like, i suppose.
 
I dont know what your particular needs are, but another option would be to make a new table for this memo field, and only allow additions, with no edits or deletes.
 

Users who are viewing this thread

Back
Top Bottom