Hi,
I'm fairly new to VBA and have a db that tracks incoming queries. I have a log on form that checks the username selected from a drop down and the password entered. This all works ok. However when the user logs on and goes into the form to enter the query details I want their username to populate a field on that screen.
The code for the log on form is as follows:
The value that is stored to MyUserID is the ID on the Users table. How to I then use that to populate a text box on another form?
Thanks,
John.
I'm fairly new to VBA and have a db that tracks incoming queries. I have a log on form that checks the username selected from a drop down and the password entered. This all works ok. However when the user logs on and goes into the form to enter the query details I want their username to populate a field on that screen.
The code for the log on form is as follows:
If Me.Password.Value = DLookup("Password", "Users", _
"[User Id]=" & Me.Username.Value) Then
MyUserID = Me.Username.Value
DoCmd.Close acForm, "LogOn Form", acSaveNo
DoCmd.OpenForm "Main Menu"
The value that is stored to MyUserID is the ID on the Users table. How to I then use that to populate a text box on another form?
Thanks,
John.