Assign *Permissions* based on Users Level.

Alocin

New member
Local time
Today, 12:02
Joined
Oct 18, 2022
Messages
7
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

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...
 
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.
 
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.
 
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.
 
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

Back
Top Bottom