Computer Learning Zone CLZ Access Excel Word Windows

True science literacy is less about what you know and more about how your brain is wired for asking questions.

-Neil deGrasse Tyson
 
Home   Courses   Index   Templates   Seminars   TechHelp   Forums   Help   Contact   Join   Order   Logon  
 
Home > Courses > Access > Seminars > Security > Lessons
Back to Security Seminar Lessons    Comments List
Upload Images   Link   Email  
Error Group Level Security
Pino Arcuri 
     
3 years ago
I am getting an error using the group level security Public Function when using the On Open, On Current or On Load properties of the form.  Error not happening if using the On Click of a button.  Attached screen shots.

Any suggestions?

Regards,
Pino
Pino Arcuri OP 
     
3 years ago

Pino Arcuri OP 
     
3 years ago

Pino Arcuri OP 
     
3 years ago

Alex Hedley 
            
3 years ago
Looks like it's not picking up a UserID
UserID=ANDGroupID=1
Kevin Robertson 
          
3 years ago
That error is telling you there is no value in Forms!MainMenuF!txtUserID. It looks like, from your second image, that you are trying to get the value before the Main Menu is loaded.
Scott Axton 
          
3 years ago
In addition to what the other guys said above, pay attention to spaces.  They matter in this case.  It looks like you need a space before AND.

The best way to troubleshoot the formula is to message box it sometimes to make sure it is working properly.
Temporarily put in this right after X=......

     MsgBox X
     Exit Sub
Scott Axton 
          
3 years ago
Make sure you are using the correct form.
I see that you are using the LoginF when you get the error.  The code in the 3rd picture is trying to refer to Forms!mainmenuf!txtUserID

I'm assuming here but I don't think you would have that value set yet on your mainmenuf yet if you are logging in.
A clue for me is that you don't have the CamelCase in your form name either.  Check spelling.
Scott Axton 
          
3 years ago
Kevin  Sorry I just saw your response.  Had the pics open in another screen when I replied and missed yours.
Kevin Robertson 
          
3 years ago
LOL Scott I do that often.
Pino Arcuri OP 
     
3 years ago

Pino Arcuri OP 
     
3 years ago

Pino Arcuri OP 
     
3 years ago

Pino Arcuri OP 
     
3 years ago

Pino Arcuri OP 
     
3 years ago
Thank you all,

Fixed the CamelCase and space before AND.  Same error.  
Deleting the On Current Event of the MainMenuF allows it move on from the LoginF and the UserID shows on the MainMenuF.


Assigning the same code to an On Click button in the MainMenuF works.

"If IsUserInGroup(1) Then
Me.FormulationSelectionCombo.Visible = False

    Else
Me.FormulationSelectionCombo.Visible = True

End If
End Sub
Adam Schwanz 
            
3 years ago
Just to confirm what is the code behind the login button? Could you also share screenshot of the 3 tables?  Users groups userxgroups. Are any of the number fields short text? Just a few ideas we might find an error in
Pino Arcuri OP 
     
3 years ago
Sorry, images attached above, I should have explained, I still want the On Current to work, assigning the code to a Command Button was only a means to test the Public code once in the MainMenuF.

Kind Regards
Pino
Adam Schwanz 
            
3 years ago
On the login form you are referring to the main menu before its even set or open. Change the forms!mainmenu stuff to the name of that combobox on your loginf
Pino Arcuri OP 
     
3 years ago
Thank you Adam,

You got it regarding the reference to the MainMenuF before being open.

Created a txtUserID on the LoginF form and changed the code to the attached.  All working as should as long as the LoginF is open, I can work around that. However, any suggestions to the IsUserInGroup code to have it referencing off the MainMenuF and close the LoginF?

Thank you for your help.

Regards
Pino
Pino Arcuri OP 
     
3 years ago

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Security Seminar Lessons.
 

 
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2025 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 1/23/2025 1:03:06 PM. PLT: 1s