Auto store date created & updated, EmpId created by and Updated by

K

kay

I don’t know what I am looking for is possible or not…
I have table CustTracking: Fields – CustID, Exc_ID, AssignedDept,
AssignedUser, EmpIDCreated, EmpIDUpdated, Comments, FollowupDt, DateCreated,
DateLastUpdated

From above fields, some fields will be entered by user, but fields –
EmpIDCreated, EmpIDUpdated, DateCreated & DateLastUpdated will be updated
automatically.

I want to create forms from this table to add and edit data but for these
fields (EmpIDCreated, EmpIDUpdated, DateCreated & DateLastUpdated) I have no
idea about how to write the code for this.
This forms opens when login is successful. So
I can explain the logic:
EmpIDCreated: When Emp Log on to this form and enter new item first time,
that EmpID should be stored in this field.
EmpIDUpdated: When Emp changes/edit the item, and who edits last time, this
field should save log on user id
DateCreated: when the item is first time created (should update from
systemdate)
DateLastUpdated: date when the item is lastupdated (should update from
systemdate)

Thanks,
 
M

Marshall Barton

kay said:
I don’t know what I am looking for is possible or not…
I have table CustTracking: Fields – CustID, Exc_ID, AssignedDept,
AssignedUser, EmpIDCreated, EmpIDUpdated, Comments, FollowupDt, DateCreated,
DateLastUpdated

From above fields, some fields will be entered by user, but fields –
EmpIDCreated, EmpIDUpdated, DateCreated & DateLastUpdated will be updated
automatically.

I want to create forms from this table to add and edit data but for these
fields (EmpIDCreated, EmpIDUpdated, DateCreated & DateLastUpdated) I have no
idea about how to write the code for this.
This forms opens when login is successful. So
I can explain the logic:
EmpIDCreated: When Emp Log on to this form and enter new item first time,
that EmpID should be stored in this field.
EmpIDUpdated: When Emp changes/edit the item, and who edits last time, this
field should save log on user id
DateCreated: when the item is first time created (should update from
systemdate)
DateLastUpdated: date when the item is lastupdated (should update from
systemdate)


The created date is trivial to do. Just set the table
field's DefaultValue to Now()

The code to set the last updated field needs to be in the
form's BeforeUpdate event procedure:
Me.DateLastUpdated = Now()
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top