Assign *Permissions* based on Users Level. (1 Viewer)

Alocin

New member
Local time
Today, 15:09
Joined
Oct 18, 2022
Messages
3
Hi all!
I am looking to solve a vba compile error.
I tried to follow Access-Diva's posted "Assign *Permissions* based on Users Level" (access-diva.com).
I believe I followed instructions well bit clearly I have not.
Using Office 2016 Access.
I am trying to create a user lever permissions to forms.
So far, the database "frmMainMenu" form comes up fine and the "frmNewUser" form comes up fine too. The "frmNewUser" form is Tagged in the "frmMainMenu" form and it too seems to open fine. However, after entering first, last names and email when I click "Continue" I get a compile error. It specifically highlights this region:

1666119924984.png
I am attaching the code for the frmMainMenu and the one for frmNewUser.
Any suggestions is truly appreciated.
Thank you
Alocin
 

Attachments

  • AccessUserPermissionLevel - MainMenu vba code.txt
    1.2 KB · Views: 84
  • AccessUserPermissionLevel - New User vba code.txt
    1.2 KB · Views: 87

theDBguy

I’m here to help
Staff member
Local time
Today, 12:09
Joined
Oct 29, 2018
Messages
21,474
Try changing the second line of the one highlighted in red to something like this:
Code:
" SELECT '" & Environ("UserName") & "','" & Me.txtFirstName & "','" & Me.txtLastName & "','" & Me.txteMail & "', Now(), 1, 9, True"
Hope that helps...
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 15:09
Joined
Feb 19, 2002
Messages
43,279
Put a stop on the execute line. Print the strSQL to the immediate window. IF you don't see the error, post the string here.
 

CJ_London

Super Moderator
Staff member
Local time
Today, 20:09
Joined
Feb 19, 2013
Messages
16,616
would have thought you would have got the error when you typed the code - it is a syntax error which is why it is red.
 

Alocin

New member
Local time
Today, 15:09
Joined
Oct 18, 2022
Messages
3
Try changing the second line of the one highlighted in red to something like this:
Code:
" SELECT '" & Environ("UserName") & "','" & Me.txtFirstName & "','" & Me.txtLastName & "','" & Me.txteMail & "', Now(), 1, 9, True"
Hope that helps...
that did it. Thanks so much for seeing something I obviously just was not seeing it. Thanks to you all.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 12:09
Joined
Oct 29, 2018
Messages
21,474
that did it. Thanks so much for seeing something I obviously just was not seeing it. Thanks to you all.
Glad to hear you got it sorted out. Good luck with your project.
 

Users who are viewing this thread

Top Bottom