Autofill Field with Employee

Creegfire

Registered User.
Local time
Today, 14:26
Joined
Dec 20, 2005
Messages
15
Hello all!

Ok, lets get down straight to the point.

What i want to achieve is that when i login that automaticly the name has been filled in on every form.

I have a login form. I put my name in there like "Michiel" and ofcourse the password. After that its going automaticly to the mainpage. In that mainpage i want to create a field that automaticly filles in my name (so if somebody else log in that their name will be filled in). After that i want when i go the incident form that automaticly the employee form has been filled in. (The person that at the moment is logged in that his name automaticly been filled in) Ive tried various ways to achieve this goal but nothing worked.

Im not that very expert in Access but im trying to understand and learning pieces by pieces the Access world. So if somebody could help me because im getting desperate! Thanks in advance all! :D

Greetz.

Creegfire
 
Do not close the opening form, but hide it.

Then on all the forms refer to the opening form to retrieve the data

Regards

The Mailman
 
namliam said:
Do not close the opening form, but hide it.

Then on all the forms refer to the opening form to retrieve the data

Regards

The Mailman

Ok, sounds logical but how can i achieve that goal?

C.
 
If you have a 'Login' button on your log in form, in it's onclick event code put DoCmd.OpenForm "frmMainPage" to open your first form, and Me.Visible = False to hide the login form. Then in the OnCurrent event of your main page form put Me.strUserName = Forms!frmLogIn!strUserName.

Larry
 
Laurentech said:
If you have a 'Login' button on your log in form, in it's onclick event code put DoCmd.OpenForm "frmMainPage" to open your first form, and Me.Visible = False to hide the login form. Then in the OnCurrent event of your main page form put Me.strUserName = Forms!frmLogIn!strUserName.

Larry


Thanks Larry for your reply (sorry that im kinda late :P) but ive tried your way and the hide my logon form is solved :) only the next problem is how can i achieve that my name is filled in. What do i need to use? Im asking this because ive tried your way but i couldnt make it work so...

EDIT

Ok, it works now that the name is automaticly filled in. Thats cool :) only ive seen a another problem and that is that Access is taking the first name of the Employee table all the time, but i must take the name what are you logging in with.

Example:

frmLogon ==> Username: Michiel
Password: Michiel
frmLogon ==> Hides

I've putted the command:

Form_Current()
Me.Name = Forms!frmLogon!Name

this code takes the name indeed of the table only it takes all the time the first name in the table.

frmIncidents ==> field Employee: Patrick ? <== heres my problem

I hope that ive explained it a bit :)

Thanks in advance!
 
Last edited:

Users who are viewing this thread

Back
Top Bottom