Computer Learning Zone CLZ Access Excel Word Windows

You have to remember something: Everybody pities the weak - jealousy you have to earn.

-Arnold Schwarzenegger
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Visitor Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Allow Edits False Disables Filter
Kiran Kaur 

3 years ago
Hi Richard,

First of all thanks for your videos,they are amazing.

I seem to have ran into a problem and cant find a solution anywhere and have tried various solutions.

I used your video on creating edit button as I want to prevent accidental changes to info however the form I have used it on has 2 combo boxes in the header which can be filtered to 'individual' name. But due to setting me.allowedits to false, I cannot filter the form unless I go into edit mode which is not ideal.

So what I am trying to achieve is to be able to filter the form from combo box without going into edit mode but keep all other fields locked from editing whilst I filter?

Your help would be much appreciated.

Thank you
Kevin Robertson  @Reply  
          
3 years ago
Instead of setting Allow Edits to false I would loop through all the controls (exclude labels, button and any controls on your form that don't have a Locked property) in the Detail section and set the Locked property of each control to False.
Kevin Robertson  @Reply  
          
3 years ago
Here is some sample code:

Set the Locked property to True (you will need a second loop to set it to False)
Dim Ctrl as Control

For Each Ctrl In Me.Section(0).Controls
   If Ctrl.ControlType <> acLabel  And Ctrl.ControlType <> acCommandButton then
      Ctrl.Locked = True
   End If
Next


.../

Toggle the Locked property between True and False
Dim Ctrl As Control

For Each Ctrl In Me.Section(0).Controls
    If Ctrl.ControlType <> acLabel And Ctrl.ControlType <> acCommandButton Then
        Ctrl.Locked = Not Ctrl.Locked
    End If
Next


.../

Toggle the Locked property between True and False, change the caption of the button
Dim Ctrl As Control

For Each Ctrl In Me.Section(0).Controls
    If Ctrl.ControlType <> acLabel And Ctrl.ControlType <> acCommandButton Then
        Ctrl.Locked = Not Ctrl.Locked
        If Ctrl.Locked Then
            YourButtonName.Caption = "Edit"
        Else
            YourButtonName.Caption = "Save"
        End If
    End If
Next
Kevin Yip  @Reply  
     
3 years ago
Another way is to put the non-editable fields in a subform with AllowEdits set to false, and the combo boxes on the main form with AllowEdits true.  The VBA code for filtering will be different in a mainform-subform setup, however.

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Visitor 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: 5/7/2026 4:53:43 AM. PLT: 1s