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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Logging form changes to a table

Status
Not open for further replies.

spoiledbrat

Programmer
Jan 1, 2001
4
US
How do I log changes in a form to a table. I have tried to do this before, but I had to open the table first before I could log the changes, how can I do this without opening the table.

Also, does anyone know how I can record everything that a person does when they enter the database. For example, which forms they open, which reports they print and also log this to a table.

Thanks
 
For the "logging" function, I have posted an article in the FAQ. I think it includes the word "History" in the title. I can't directly reference it at the moment, but if you search for "history" or "tblHistory" or "transaction log" I,m pretty sure you'll find it. You need to be aware that these tables generaly 'grow' MUCH faster than the actual database tables, as every field change is logged as a seperate entry. When I include this in a app, I also include an automatic "archive/purge" function to keep the history from growing to much. You need to do this part on your own, as the criteria to use will be specific to your app and situation.

For the second part, - logging EVERY ACTIVITY - It CAN be done, but like the Tic-Tac commercial says: "I wouldn't recommend it".

With a few exceptions, the history log would include the relevant information re "who done it". One possibly relevanbt execption might be the reporting. Here, I believe you can accomplish your goal via two approaches:

A.[tab]Just include the user's name & date/time in the footer of the report. Where a report varies due to user input, include the user input in the title of the report (e.g. if the user selects a date range for the report, Change the title to read "MyReportTitle" & " From " &[StrtDt] * " to " & [EndDt]) Numerous variations on this approach are possible, and provide a "WRITTEN" record of the report generation.

B.[tab]Not really any different than the above, except on on each report instantiation, enter the same info into a log file. Use the 'Open' event and include the relevant info.

Actually ther is no reason you can't do both.



MichaelRed
mred@duvallgroup.com
There is never time to do it right but there is always time to do it over
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top