Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Field modified 1

Status
Not open for further replies.

SeeJane

Technical User
Jun 5, 2002
67
US
Hi all,

I'm working on a table (tblModified) that tracks changes to another table in my database. What I'm trying to do is figure out how to record the name of the field that was modified. I've seen plenty on getting the date, user, and original value, but nothing on the field itself. Does anybody have an idea?

thanks a ton,
CJ


 
There is a fields collection with either a DAO or ADODB recordset. The fields collection contains information on each field. Some information shown below. You probably could check original value against value to know the field changed and then pick up the field name.

rs.Open sql1, cn, adOpenStatic, adLockOptimistic

Dim fl As ADODB.Field, indx As Integer
For Each fl In rs.Fields
Debug.Print "The Field Name = "; rs.Fields(indx).Name
Debug.Print "The Field Type = "; rs.Fields(indx).Type
Debug.Print rs.Fields(indx).OriginalValue
Debug.Print rs.Fields(indx).Value
indx = indx + 1
Next
 
Thanks - it's working like a charm. Enjoy your star!

CJ
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top