Building history table...

jeo

Registered User.
Local time
Today, 22:38
Joined
Dec 26, 2002
Messages
299
Hello.
I'm building a history table to keep track of some changes that occur on one of my forms.
Here is what I'm using to build my history table:
Dim rs As DAO.Recordset
Set rs = CurrentDb.OpenRecordset("tblDateCycleTestingChanges", dbOpenDynaset)
With rs
.AddNew
![CycleTestingDatesID] = Me.CycleTestingDatesID.Value
![Changed] = Now()
![ClientID] = Me.ClientID.Value
![ProjectID] = Me.ProjectID.Value
![TaskID] = Me.TaskID.Value
![TaskStartDt] = Me.TaskStartDt.Value
![TaskEndDt] = Me.TaskEndDt.Value
.Update
End With
Set rs = Nothing
End If
I have 2 questions:
1. I'm not sure where to insert this event. I'm thinking on Before_Update on the updated field? (I don't want to put it into Before_Update for a form event as I have other things that are being filled out/changed and I only want to keep track if certain fields on the forms are updated/changed.
2. I would also like to keep track of Old and New values for those specific fields. Is that at all possible?
Thanks.
 
Thanks.
I will try that...
Hopefully I will make it...
 
Well...i didn't last too long.
It seems that my code is not working at all...
Dim rs As DAO.Recordset
Set rs = CurrentDb.OpenRecordset("tblDateCycleTestingChanges", dbOpenDynaset)
With rs
.AddNew
![CycleTestingDatesID] = Me.CycleTestingDatesID.Value
![ClientID] = Me.ClientID.Value
![ProjectID] = Me.ProjectID.Value
![Changed] = Now()
![TaskID] = Me.TaskID.Value
![TaskStartDt] = Me.TaskStartDt.Value
![TaskEndDt] = Me.TaskEndDt.Value
.Update
End With
Set rs = Nothing
End If
It doesn't work in the After-Update event, i tried putting into a on-click even just to test it and nothing happens with my tblDateCycleTestingChanges.
Can anyone tell me what is wrong with my code? Thanks!
 
Something strange must be going on with it...
Thanks for all your help.
 

Users who are viewing this thread

Back
Top Bottom