Logon username

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

Guest

Hello

I setup my user groups etc to match those of our server. As such, my database user name will be the same as that used to log onto my computer

Is there a way that when I log onto my database the computer's user name would be inserted in the database logon user name field? This way I wouldn't have to create a sepearte shortcut for every user

Thanks

Daniel
 
Every time I open Access, my userid defaults in from the last time I signed
on. I am using A2K on Windows NT.


Daniel P said:
Hello,

I setup my user groups etc to match those of our server. As such, my
database user name will be the same as that used to log onto my computer.
Is there a way that when I log onto my database the computer's user name
would be inserted in the database logon user name field? This way I
wouldn't have to create a sepearte shortcut for every user!
 
Daniel,

Assuming you have setup Access user & group level security:
Me.txtUserName = dbEngine(0).UserName

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia


Daniel P said:
Hello,

I setup my user groups etc to match those of our server. As such, my
database user name will be the same as that used to log onto my computer.
Is there a way that when I log onto my database the computer's user name
would be inserted in the database logon user name field? This way I
wouldn't have to create a sepearte shortcut for every user!
 
Graham

Could you give me a little more info..

where do I need to use this code? I have been unable to locate the actual logon form...where is it store? Is this code to be used witht the logon form?

Please give me a bit more. Please

Thanks

Daniel
 
Hi Daniel,

After *carefully* reading your request I don't "think" it's possible.
No code in the database is executed BEFORE the login form appears. Period.
So any attempt to load a predetermined value into a text field on the login form
will simply not work given that restriction. In addition, you cannot make ANY
changes to the login form that appears on a secured Access database. There is
no exposure of this object for the developer to change.

I see only two possibilities for you:

1. As Rick mentioned, the login screen by default will display the last user name who
used the database. So they only have to type in their user name once. After that all
they would have to do is enter their password. Would that not suffice?

2. Create your own login form in a second unsecured database. Since it is unsecured
there will be no login prompt. You create a single pop-up, modal form in this database
and set it to be the Startup form. Using code you automatically fill in the User Name
text field for them. All they have to do is fill in the password text box and hit an OK
button. Code behind the OK button opens up your secured database, passes in the
user name and password from the text boxes, and then closes the unsecured database.
To the user they'll never even know they are working with two databases for a brief
second. Just an idea.

**Note** If the user name/password combination entered is invalid, the user will
STILL be presented with the default Access login form for the secured database!
So then you're back to square one though!

Jeff Conrad
Access Junkie
Bend, Oregon

Daniel P said:
Graham,

Could you give me a little more info...

where do I need to use this code? I have been unable to locate the actual logon form...where is
it store? Is this code to be used witht the logon form?!
 
Back
Top