Obtain and Insert UserID

A

ajhome

Greetings...
What is the best way to insert the UserID into a field in my table. Users
will have to sign into the database.

Thanks,
Aj
 
A

ajhome

I have tried to use that code, and it didn't work. Would you please advise
me as to how to use it?

Thanks,
Aj
 
D

Douglas J. Steele

You're talking about the code from "The Access Web"?

Create a new module (not a class module or the module associated with a
form) and copy everything between Code Start and Code End into that module.
Make sure you do not name the module fOSUserName: modules cannot have the
same name as existing subs or functions.

Simply call the function fOSUserName() whereever you want the user id.
 
D

Douglas J. Steele

If you want the user id inside your sub procedure, yes, you'd use
fOSUserName()
 
A

ajhome

I am sorry to be so slow with this, however, I do have one more question. I
have a text box that I want the UserID to go into. How would I populate that
text box using that function?
 
D

Douglas J. Steele

Me!NameOfTextbox = fOSUserName

You also can set the ControlSource to "=fOSUserName()" (no quotes, but the
equal sign and parentheses are necessary) if you don't care about storing
the value, or the DefaultValue to "=fOSUserName()" if you do.
 
Top