Obtain and Insert UserID

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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
 
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.
 
If you want the user id inside your sub procedure, yes, you'd use
fOSUserName()
 
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?
 
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.
 
Back
Top