Show who you are logged in as?

surfrus

Registered User.
Local time
Today, 05:33
Joined
Dec 11, 2012
Messages
14
i have a created a login form on my database that has too be correctly filled out before you can view anything, i was wondering if there is a way that i can show in the corner of my Navigation form who i am logged in as, for example there are multiple users Eg "admin" and "Steve" if i log in as admin can i make it show that in the corner?
 
That doesnt really help to be honest, sorry
 
Create an unbound Text box and have its Control Source as
Code:
=DLookUp("[UserNameField]","[UsersTableName]","[UserID]=" & [Forms]![LoginFrm]![LoginTextBox])
[UserNameField] = Is the Name of the Field that has the User name.
[UsersTableName] = The table name.
[UserID]= The unique ID that represent each user.
[Forms]![LoginFrm]![LoginTextBox] = Is the Login Form through which you collect the information.
 
That doesnt really help to be honest, sorry

When you post response like this, the reader has no idea what exactly is the issue. Did you not understand the information at the link? That information shows you how to put the current user name into a variable.

Do you not have experience with Forms or controls?
Perhaps you could have shown us the Form or told us the name of the table associated with your login Form.

We make the best guess we can when there is limited info in the post. We can't assist unless we understand your situation. Hopefully someone else will interpret your post sufficient to help you.

Please see this link for Posting questions on this forum, it will improve communications and focus responses.

http://www.access-programmers.co.uk/forums/showthread.php?t=223418

Good luck with your project
 
Im struggling too make it work, it just says " #Name? " in the unbound text box?
 
Is the Login Form still active? Or have you closed it after logging in? If you have do not close the Login but set it invisible so that this Form can look into..

What I am saying is OnClick of the Login button instead of having,
Code:
DoCmd.Close acForm, Me.Name
Have,
Code:
Me.Visible = False
So when you use the DlookUp it will be able to get the values..

As jdraw mentioned,
We make the best guess we can when there is limited info in the post. We can't assist unless we understand your situation.
from your next post try to explain your scenario better, also try to acknowledge them with what you could not follow/what you mean by your post; more elaborately..

This is not to put you down.. but will help us to help you better..
 
Here are 2 screen shots Design showing a sample Form with Control source for a text box, and showing the Form view.

Good luck with your project, hope these jpgs help.
 

Attachments

  • PutCurrentUserNameInATextBoxDesign.jpg
    PutCurrentUserNameInATextBoxDesign.jpg
    52.4 KB · Views: 111
  • PutCurrentUserNameinATextBoxFormView.jpg
    PutCurrentUserNameinATextBoxFormView.jpg
    8.1 KB · Views: 122
(ignore this post)
 

Attachments

  • NUMBER1.jpg
    NUMBER1.jpg
    89.1 KB · Views: 106
  • number2.jpg
    number2.jpg
    97.4 KB · Views: 105
  • number 3.jpg
    number 3.jpg
    97.8 KB · Views: 107
ignore this (just need my post count 10 too show the images i did screen shots of)
 
Right, what happens is, you open the database and there is a modal dialogue box that says Username and password, when you enter your username and password the box then displays a different form (frmNavigation) what i need too do is show who the user is when it goes too the "frmNavigation" this is because frmnavigation is the only form that a user should need as all my forms are incorporated into it.

See Shots:
http://i47.tinypic.com/2mr8t2e.jpg[/url] <-- what you first see
http://i45.tinypic.com/zoj1u9.jpg[/url] <-- Once logged in
http://i47.tinypic.com/35bcdvl.jpg[/url] <-- Shows the command source and the form

hope this is a bit clearer, sorry about before
 
I appreciate what your question wasn't.
Most people don't read the sticky posts, unfortunately.

Anyway, did you get your form working with the username?
 
my question wasn't can you show me every single witty post on the help forumns.

I do not think that is the intention here. jdraw was doing what we all do. He was suggesting options for you to consider.

Let's try something different.

Have you considered using a PUBLIC variable to hold any Information that needs to be shared between Forms?

In a Common Module (not the PRIVATE Form Module), define a Variable to hold the UserName as follows:

PUBLIC theUserName As String

In your Login Form, when the user Enters an ID, you update theUserName to reflect the new ID. Any other Form that needs to know the UserName can refer to the PUBLIC variable.
 
I do not think that is the intention here. jdraw was doing what we all do. He was suggesting options for you to consider.

Let's try something different.

Have you considered using a PUBLIC variable to hold any Information that needs to be shared between Forms?

In a Common Module (not the PRIVATE Form Module), define a Variable to hold the UserName as follows:

PUBLIC theUserName As String

In your Login Form, when the user Enters an ID, you update theUserName to reflect the new ID. Any other Form that needs to know the UserName can refer to the PUBLIC variable.

so how would i go about doing this?
 

Users who are viewing this thread

Back
Top Bottom