Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access thread: How do I create a Transaction Log in Access?


Message #1 by "David Cope" <dcope@m...> on Wed, 15 Jan 2003 15:09:32
I have got a form based on purchase orders.  I would like to know how to 
automatically enter this data into a "transaction log" for PO's when a PO 
is created or edited as new rows on this table.  Any suggestions?  

I would greatly appreciate the help!!
Message #2 by "zak willis" <zak@z...> on Fri, 17 Jan 2003 17:05:54
> I have got a form based on purchase orders.  I would like to know how to 
a> utomatically enter this data into a "transaction log" for PO's when a 
PO 
i> s created or edited as new rows on this table.  Any suggestions?  

> I would greatly appreciate the help!!

The reason nobody has answered your question is because it is stupid. Only 
databases such as SQL Server and Oracle use transaction logging, and you 
set up triggers on tables for activities such as this. Indeed this is 
access's major failing. However, you could try a work around by setting up 
a form as the only method by which a user can add or edit data. Then trap 
the form's and control's after_update, event. If an edit, or insert has 
occurred, store the PO number in a separate table along with the user name 
or whatever other information you need to store. 
set db = currentdb()
db.execute "INSERT INTO " etc

Remember though that an intelligent user could access the back end of the 
database using ADO, DAO, etc, and you would need a secure access database 
to prevent this happening. Further more, you may need to trap certain 
keypresses, in case the person pressed escape and removing any data 
modification, but your transaction log would still contain a pointer to a 
record that was not changed. I hope this helps. If you have a version of 
SQL server then I recommend using this instead for this type of 
requirement. 
Hope this helps.
Zak :) I didn't mean to be offensive by the way.
Message #3 by "Richard Gibson" <rgibson@w...> on Fri, 17 Jan 2003 17:00:13 -0000
I've done something similar in the past with access.

I wanted to store the changes made to a record each time a user edited it.

I created an unbound form with a combo box which then populates the form
based on the record selected (in my case customer details).

For each field on the form that can be edited I created a double click event
on that field.  Using an input box the user can type in the new value for
that field and I use a recordset to update the relevant field in the
underlying table.  My vba adds a record to a history table at the same time
showing the customer name/no, the field changed, the original value and the
new value as well as the userid of the person making the change.

The changes for any record can be pulled up using a simple query feeding a
popup form.

For new records I included a "datecreated" field which was populated
automatically each time a record was added.

-----Original Message-----
From: zak willis [mailto:zak@z...]
Sent: 17 January 2003 17:06
To: Access
Subject: [access] Re: How do I create a Transaction Log in Access?


> I have got a form based on purchase orders.  I would like to know how to
a> utomatically enter this data into a "transaction log" for PO's when a
PO
i> s created or edited as new rows on this table.  Any suggestions?

> I would greatly appreciate the help!!

The reason nobody has answered your question is because it is stupid. Only
databases such as SQL Server and Oracle use transaction logging, and you
set up triggers on tables for activities such as this. Indeed this is
access's major failing. However, you could try a work around by setting up
a form as the only method by which a user can add or edit data. Then trap
the form's and control's after_update, event. If an edit, or insert has
occurred, store the PO number in a separate table along with the user name
or whatever other information you need to store.
set db = currentdb()
db.execute "INSERT INTO " etc

Remember though that an intelligent user could access the back end of the
database using ADO, DAO, etc, and you would need a secure access database
to prevent this happening. Further more, you may need to trap certain
keypresses, in case the person pressed escape and removing any data
modification, but your transaction log would still contain a pointer to a
record that was not changed. I hope this helps. If you have a version of
SQL server then I recommend using this instead for this type of
requirement.
Hope this helps.
Zak :) I didn't mean to be offensive by the way.


Message #4 by PStreeter@C... on Fri, 17 Jan 2003 11:16:55 CST
On Fri, 17 Jan 2003 17:05:54 "zak willis" wrote:


> The reason nobody has answered your question is because it is stupid. 

Excuse me, but the question is not stupid. It shows ignorance of the 
capabilities of Access, which is why it was asked. No one poses  
questions to this group on things they are not ignorant about.

Paul



  Return to Index