View Full Version : Column History


Teady91
07-05-2010, 03:36 PM
Hi All,
I am Currently in the process of designing an asset database for work. One of the features i am trying to design is a tracking feature whereby a history of the location of an asset is recorded and displayed in a form.
i have been using the column history function in access 2007. the way i have it set up is so that when a button is pressed the history is displayed in a text box.
i used the following code:

Private Sub PB_LocationHistory_BatteryTools_Click()

'Is Null Command

TXB_LocationHistory_BatteryTools.Value = Application.ColumnHistory("Assets", "Location", "ID=" & ID & "")

End Sub

when i press the button i get a runtime error 424

the strange thing is, i have used this exact code in another form on my database and it works fine...

please help :confused:

if anyone can suggest a better way to do this please do!

Thanks,

Teady

boblarson
07-05-2010, 04:30 PM
1. Is ID numeric or text?

2. I'm assuming it is numeric here:

TXB_LocationHistory_BatteryTools.Value = Application.ColumnHistory("Assets", "Location", "[ID]= " & Me!ID )

(you don't need to put & "" at the end of that.

3. If text then it would be:

TXB_LocationHistory_BatteryTools.Value = Application.ColumnHistory("Assets", "Location", "[ID]=" & Chr(34) & Me!ID & Chr(34))

Teady91
07-05-2010, 07:06 PM
Thanks,
This works for one of the forms, but when i duplicate it on another form i get a runtime error '2147467259 (80004005)' Method 'ColumnHistory' of object '_Application Failed'.

Any Ideas???

Cheers,
Teady

boblarson
07-05-2010, 07:32 PM
Does ID exist in the form's recordset? It needs to be in the recordset - it doesn't need to be on the form but does need to be in the recordset.

Teady91
07-05-2010, 08:32 PM
yea, it exists, i found the problem, thanks for considering it :)

very helpful!

Cheers,
Teady

nk100
05-25-2012, 06:42 AM
Hi Teady,

I found your post that you have found the problem with Column History.
I have the same problem. would you let me know what was the problem?
Thanks

NK