P
PC User
<<BACKGROUND>>
I've made Audit Trail fields to track the actual changes to the data.
As a routine, I add 4 fields to my main data tables:
CreatedBy, CreatedWhen, EditedBy, EditedWhen
On my forms, I add controls for all four and set the Visible property
of them to False. The CreatedWhen control is set to default to Now().
The CreatedBy control defaults to fOSUsername() (which is a function
found at http://www.mvps.org/access/api/api0008.htm to get the network
logon ID of the user). In the Before Update event of the form, I add
the following code:
Me!EditedBy = fOSUserName()
Me!EditedWhen = Now()
This results in a date and time stamp of when the record was created
and Edited and Eho created and/or edited it.
<<PROBLEM>>
In our company's Outlook Contact list the fields include the userID,
the first name and the last name. I've linked a table to this Outlook
Contact List and made a query with one of the fields to concatenate
the first and last names.
FullName: [Global Address List]![First] & " " & [Global Address
List]![Last]
In the second column of the query I have the userID which has the
field name [Account]. My question is that in the Audit Trail fields
mentioned above, I want to programically have the user's full name be
inserted into the fields CreatedBy and EditedBy instead of the userID
number from the network. How do I link the [FullName] from the query
to these fields so that the user's full name is placed into the main
table.
Thanks,
PC
I've made Audit Trail fields to track the actual changes to the data.
As a routine, I add 4 fields to my main data tables:
CreatedBy, CreatedWhen, EditedBy, EditedWhen
On my forms, I add controls for all four and set the Visible property
of them to False. The CreatedWhen control is set to default to Now().
The CreatedBy control defaults to fOSUsername() (which is a function
found at http://www.mvps.org/access/api/api0008.htm to get the network
logon ID of the user). In the Before Update event of the form, I add
the following code:
Me!EditedBy = fOSUserName()
Me!EditedWhen = Now()
This results in a date and time stamp of when the record was created
and Edited and Eho created and/or edited it.
<<PROBLEM>>
In our company's Outlook Contact list the fields include the userID,
the first name and the last name. I've linked a table to this Outlook
Contact List and made a query with one of the fields to concatenate
the first and last names.
FullName: [Global Address List]![First] & " " & [Global Address
List]![Last]
In the second column of the query I have the userID which has the
field name [Account]. My question is that in the Audit Trail fields
mentioned above, I want to programically have the user's full name be
inserted into the fields CreatedBy and EditedBy instead of the userID
number from the network. How do I link the [FullName] from the query
to these fields so that the user's full name is placed into the main
table.
Thanks,
PC