Adding name of record creator to table (fOSUsername)

garywood84

Registered User.
Local time
Today, 18:10
Joined
Apr 12, 2006
Messages
168
I want to keep a record of who adds records to a table. I've created a field called "CreatedBy", and set its default value to =fOSUserName().

I've got code to get the UserName currently logged in to the OS from here: http://www.mvps.org/access/api/api0008.htm. I copied this code, created a new module and pasted it in.

However, when I try to save my table, I get the following error message:

"Unknown function 'fOSUserName' in validation expression or default value on 'Table2.CreatedBy'."

Can anyone advise me what I've done wrong, please?

Thanks,

Gary
 
This exact same question has come up before and it may be due to this: -

>>(A) Paste the following code in a new module and call the function fOSUserName.<<

When they give the instruction to ‘call the function fOSUserName’ they mean to call the function as fOSUserName. They do not mean call the module fOSUserName.

I will assume that you have created a module and named it fOSUserName but that’s not going to work.

Change the module name to something other than fOSUserName.
 

Users who are viewing this thread

Back
Top Bottom