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!

Access 2000 - transaction logging 2

Status
Not open for further replies.

jtcc001

Programmer
Aug 1, 2002
4
US
I need a way to add some transaction logging to my database. Currently administering a database that tracks all work processes/leased pcs. Want to know how to add a time and date stamp as well as technician's initials to the end of a field after they put in there work comments and tab out of it.
 
Maybe this will be more specific.

Memo Field named Tech_Notes

When tecnician tabs out of field or clicks save record, I want their notes saved as well as this on the end (XX 8/1/02). This way I can track all work ever performed on a system and who did it.

Example Tech note:

"Received system. Missing HDD. Part ordered. (JT 7/30/02)"

Then the next time the record is changed this would be saved:

"Received system. Missing HDD. Part ordered. (JT 7/30/02) HDD received. Replaced. Processed system for end of lease. Staged for shipment to OEM (JT 8/1/02)"
 
Rather than having a memo field that keeps getting larger, it would be better if you stored all the different comments seperately. If you wanted to view them all together at some point you could create a report to do that.
If you do it this way, you will be able to produce reports that list who did what on the job, or which different jobs a person did without having to look through the memo field manually.
If you want more help/advice let me know.

Ben ----------------------------------
Ben O'Hara
Home: bpo@RobotParade.co.uk
Work: bo104@westyorkshire.pnn.police.uk
Web: ----------------------------------
 
Thanks for the idea. Well worth looking into. I am still a beginner at programming so I often don't see the obvious. Does anyone know the code to add the comments anyway though. Just knowing how will help with other things that I wish to do with this project.

James
 
I infer from your comments that you are just appending their notes to this memo field. Bind the memo field to a form control and set its property to hidden so it can't be accessed by the user. Then, use the AfterUpdate event for the notes control similar to the following:

Private Sub NotesFormControlName_AfterUpdate()

HiddenFieldName = HiddenFieldName & " " _
& NotesFormControlName & " (" & UserID & " " _
& NOW() & ")"

End Sub

The _ are just line continuation indicators. There are system functions available to get UserID, etc if you don't currently have it. Now will return a full date & timestamp as well.

Good Luck!
 
Thanks! Both Ideas were beneficial. SBendBuckeye is what I was looking for. Can't believe it was that simple...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top