Hi, I'm quite a noob at access and I've recently starting applying vba in a database I've been tasked with to create for my department.
I've got this code that I've written that allows users to access a ribbon or specifically a button on a ribbon, and I want it to open the window if the specified user is an admin, however if not then it will come up with a message "Access required".
I had an issue that both windows would pop up for both users, so I added "gototheend" (see below) so it would skip part of the code however the moment I add that code in it gives me the error message shown in the title. If anyone could help that
would be greatly appreciated thanks!
my code for reference:
If GBL_Mode = "Admin" then GoTo Proto
If GBL_Mode = "User" then GoTo Bravo
Proto:
DoCmd.OpenForm"Usercontrol", acNormal, "", "", , acNormal
gototheend
Bravo:
Msgbox "Access Required"
End Function