NearImpossible
Registered User.
- Local time
- Today, 11:02
- Joined
- Jul 12, 2019
- Messages
- 225
I am working on a database that will either automatically add a network user to the UserLogins table, and then open the UserInformation form to that record so they can add in their details, or if they already exist in the UserLogins table, then they will be redirected to the appropriate form based on their permission level.
I have a function to get the User Name for the individual launching the database and then pass that to the UserLogins table, which is working.
Currently I am stuck at opening the UserInformation form to the newly added record as it adds the name to the table correctly, but then I am presented with an "Enter Parameter Value" for the NetworkUser, vs it being passed through.
When I type in the NetworkUser, it opens the form and displays the correct record.
Here is the code I have
Any help is apprechiated
Thank you
Kevin
I have a function to get the User Name for the individual launching the database and then pass that to the UserLogins table, which is working.
Currently I am stuck at opening the UserInformation form to the newly added record as it adds the name to the table correctly, but then I am presented with an "Enter Parameter Value" for the NetworkUser, vs it being passed through.
When I type in the NetworkUser, it opens the form and displays the correct record.
Here is the code I have
Code:
Dim Rs As Recordset
'Check to see if the Network User is a new user and opens the applicable forms
UsrLogin = DLookup("UserLogin", "dbo_db_UserLogins")
If IsNull(UsrLogin) = True Then
'Adds first Network User to UserLogins table and opens User Information form
Set Rs = CurrentDb.OpenRecordset("dbo_db_UserLogins", dbOpenDynaset, dbSeeChanges)
Rs.AddNew
Rs!UserLogin = NetworkUser
Rs.Update
[COLOR="Red"][B] DoCmd.OpenForm "UserInformation", , , "[UserLogin]= " & NetworkUser[/B][/COLOR]
Else
If UsrLogin = NetworkUser Then
'Opens applicable form
Else
'Adds new Network User to UserLogins table and opens User Information form
Set Rs = CurrentDb.OpenRecordset("dbo_db_UserLogins", dbOpenDynaset, dbSeeChanges)
Rs.AddNew
Rs!UserLogin = NetworkUser
Rs.Update
[COLOR="red"][B] DoCmd.OpenForm "UserInformation", , , "[UserLogin]= " & NetworkUser[/B][/COLOR]
End If
End If
Any help is apprechiated
Thank you
Kevin