Hi,
I have a subform within a form and would like to record details of which user last modified the data, I am getting userID from pc login but have no idea how to proceed further, any help given would be much appreciated,
Thanks in advance
Hi,
I have a subform within a form and would like to record details of which user last modified the data, I am getting userID from pc login but have no idea how to proceed further, any help given would be much appreciated,
Thanks in advance
Create a "LastUpdateUser" and "LastUpdateDateTime" field in your table. Then create a text box that is bound to each of those fields. Hide the text boxes and when a user makes a change you want to track have some VBA code set up to dump the UserID and Date into the necessary text boxes.
Kevin,
I'm not sure if it would help, but I have a published article about audit trails here: http://www.databasedev.co.uk/audit_trail.html
Maybe it can help give insight.
Many thanks for the info will try over weekend.
Cheers
Kev
Many thanks,
Have tried it and it works, will also try to set up an audit trail as advised Adam
Cheers
Guyz
marked solved
Here's a simple way to set up an auditing trail if you're interested.
https://www.accessforums.net/code-re...rds-10212.html
It doesn't have all the overhead coding I've seen with other methods.
pkstormy, i downloaded your db, imported the modules and class modules, and i forget what else i did cuz my brain is tired right now (lol), but i'm getting the following error when i make an edit to a field on the form:
"Compile error:
User-defined type not defined"
the following line is then highlighted yellow with an arrow pointing towards it in vb editor:
and "As ADODB.Recordset" is highlighted in this line:Code:Function LogDataChange(IDValue As Variant, TblName As Variant, FldName As Variant, OldValue As Variant, NewValue As Variant)
Code:Dim rs As ADODB.Recordset
edit: fixed! in vbedit, i had to go to tools>references and check "Microsoft ActiveX Data Objects 2.1 Library". now it's working gloriously. thanks for example!
I was just going to recommend going to the References when I read the last line in your post. Thanks for letting me know. I'm glad you got it working. I use this technique quite often for our medical data.