View Full Version : Modified by field?


Sol
09-05-2000, 07:11 AM
Do you know how I can automatically fill in who a form was modified by based on a users Access login?

Thanks much!

Karl K
09-05-2000, 09:24 AM
Use the CurrentUser() function. That is the login name of the current user.

Lets say you have two fields:
TimeUpdated
UpdatedBy

In the Before Update for the form:
Me![TimeUpdated] = Date
Me![UpdatedBy] = CurrentUser

That should do it. Make sure you don't put this stuff in After Update or you'll get stuck in a loop.

Sol
09-05-2000, 11:19 AM
Thanks, that did work. Do you know if there is a way to distinguish between Created By and Modified By? I need to keep track of both.

Thanks!

Pat Hartman
09-05-2000, 12:54 PM
Add additional colums to the table if you need to track created by and modified by separately. Check the NewRecord property to determine if the record is new or old.

Karl K
09-06-2000, 02:49 PM
Or, use a field CreatedBy with a default value (set in properties) of CurrentUser(), and don't change it.