Iok.. I need to track all changes in a table...
The only way to access the table is thru a subform hooked in...
Now in playing with the before/after updates... I see I can hit these and record the change after update.... but it will be a MAJOR pain to do this code for EACH field... not only that.. just realized that if I change one field.. move to the next in the same record.. then hit esc.. it cancels the change!
here is what I have so far.. (Just for one field)
there must be a better way to do this....
VB Code:
Private Type tData RecNum As Integer PrevVal As String NewVal As String FieldName As String End Type Dim FLD As tData Private Sub LOGCHANGE() Debug.Print FLD.FieldName Debug.Print FLD.RecNum Debug.Print FLD.PrevVal Debug.Print FLD.NewVal End Sub Private Sub ADDRESS_AfterUpdate() FLD.NewVal = ADDRESS.Value FLD.FieldName = "ADDRESS" LOGCHANGE End Sub Private Sub ADDRESS_BeforeUpdate(Cancel As Integer) FLD.PrevVal = ADDRESS.OldValue FLD.RecNum = Me.CurrentRecord End Sub
Thanks!




Reply With Quote