You are looking for something analogous to a trigger in SQL Server. There are no table triggers in Access, so you need to do this programatically in the front end.
You can put 2 columns in the table called DateCreated, and one called DateModified, and set their data type to Date/Time. Then set their default values to Now().
Create two more fields in the table called WhoCreated and WhoModified, and data type Text.
Then on your data entry form, add this code:
On the Before Insert Event:
Dim sUser As String
sUser = (Environ$("Username"))
Me.WhoCreated = sUser
On the Before Update Event:
Dim sUser As String
sUser = (Environ$("Username"))
Me.WhoModified = sUser
Me.DateModified = Now()
Remember to put these 4 controls on your form, but then set their Visible property to No.
This will tell you who created a record, and who modified a record the last time, if your users are using the form.
You can then do a query on DateCreated and DateModified and select those where these values are not equal (since they will be equal if the record is created but never modified.)
Does that help?
mmcdonal
|