Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / May 2007

Tip: Looking for answers? Try searching our database.

Obtain and Insert UserID

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ajhome - 16 May 2007 16:33 GMT
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
Douglas J. Steele - 16 May 2007 17:32 GMT
The CurrentUser function returns the ID they used to log into the database.

If you'd rather have their network ID, check
http://www.mvps.org/access/api/api0008.htm at "The Access Web.

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

> 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
ajhome - 16 May 2007 17:42 GMT
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

> The CurrentUser function returns the ID they used to log into the database.
>
[quoted text clipped - 7 lines]
> > Thanks,
> > Aj
Douglas J. Steele - 16 May 2007 17:53 GMT
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.

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

>I have tried to use that code, and it didn't work.  Would you please advise
> me as to how to use it?
[quoted text clipped - 15 lines]
>> > Thanks,
>> > Aj
ajhome - 16 May 2007 19:00 GMT
Would I call function fOSUserName()  inside of a sub procedure?

> You're talking about the code from "The Access Web"?
>
[quoted text clipped - 24 lines]
> >> > Thanks,
> >> > Aj
Douglas J. Steele - 16 May 2007 19:19 GMT
If you want the user id inside your sub procedure, yes, you'd use
fOSUserName()

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

> Would I call function fOSUserName()  inside of a sub procedure?
>
[quoted text clipped - 28 lines]
>> >> > Thanks,
>> >> > Aj
ajhome - 16 May 2007 19:31 GMT
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?

> If you want the user id inside your sub procedure, yes, you'd use
> fOSUserName()
[quoted text clipped - 31 lines]
> >> >> > Thanks,
> >> >> > Aj
Douglas J. Steele - 16 May 2007 19:58 GMT
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.

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

>I am sorry to be so slow with this, however, I do have one more question.
>I
[quoted text clipped - 40 lines]
>> >> >> > Thanks,
>> >> >> > Aj
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.