Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Make form read only
Robert Freeman 
      
3 years ago
Hi. I am trying to make a form (and its sub-forms) read only unless specific people are logged in. I already have one On_Load event running.
I've watched Richard's video on this (Edit Mode) but cannot figure out how to get the two event to run when loading the form. Ideally I'd like to use the TempVars function, which is already set up, to allow certain users full access but stop other users from being able to edit.
Is there a video available on running two onload events or can anyone please offer me advice. Thanks.
Sami Shamma  @Reply  
             
3 years ago
why don't you put both conditions in the same on load event?
Robert Freeman OP  @Reply  
      
3 years ago
I think that's what I need to do but cannot figure out the vba to run two events, presumably, one after the other. Just reaching out for guidance on that really.
Kevin Robertson  @Reply  
          
3 years ago
There is only one OnLoad event per Form. Use an If Then block to decide who can edit and who can't.
Kevin Robertson  @Reply  
          
3 years ago
Richard shows how to limit access to which Forms users have access to in the Access Security Seminar.
Sami Shamma  @Reply  
             
3 years ago
There is also a TechHelp video on simple security that can help you at your level.

https://599cd.com/blog/display-article.asp?ID=1435
Robert Freeman OP  @Reply  
      
3 years ago
Hi all. Thanks for your help so far - I'm getting there BUT ... would some please tell me what is wrong with the following line of code:
Forms("MemberDetailF").MemberInfoChoicesF.AllowEdits = True

I'm getting a runtime error.

MemberDetailF is the main form and MemberInfoChoices is a sub form.

Thanks.
Kevin Robertson  @Reply  
          
3 years ago
You need to add .Form to access the properties of the subform.

Forms("MemberDetailF")!MemberInfoChoicesF.Form.AllowEdits = True
or
Forms!MemberDetailF!MemberInfoChoicesF.Form.AllowEdits = True

Value From a Form
Value From Subform
Bang! v Dot.
Robert Freeman OP  @Reply  
      
3 years ago
Thanks Kevin.
I've tried that and it's still giving me a run time error: Access can't find the field 'MemberInfoChoicesF' referred to in expression.

Any suggestions please.
Kevin Robertson  @Reply  
          
3 years ago
Check the name of the Subform object. Not the Source Object, the actual name of the control.
Robert Freeman OP  @Reply  
      
3 years ago
So I finally figured this out - the vba is looking for the 'name' of the form NOT the Source Object. The following works:
Forms!MemberDetailF!("Member Information Form").Form.AllowEdits = True

Thanks for all the pointers.

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Forum.
 

Next Unseen

 
New Feature: Comment Live View
 
 

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 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 6/16/2026 7:29:26 PM. PLT: 0s