Go Back   Access World Forums > Microsoft Access Discussion > Forms

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 06-13-2019, 11:47 AM   #1
billgyrotech
Banned
 
Join Date: Apr 2013
Posts: 258
Thanks: 67
Thanked 3 Times in 3 Posts
billgyrotech is an unknown quantity at this point
Lock Fields on Form and Subform Based On One Field Value

Hi,


I have a form AFRs that has the field 'Status'. Is there a way to lock all fields on the form and the subform AFRsParts when the Status field is "Closed"? Also a way to change the Status to "Open" and have the fields unlocked in case there needs to be changes made.


Thank you very much for your help


PS Hold down shift key to open the database showing the navigation pane if needed.


Last edited by billgyrotech; 06-14-2019 at 02:03 AM.
billgyrotech is offline   Reply With Quote
Old 06-13-2019, 12:10 PM   #2
theDBguy
Iím here to help
 
theDBguy's Avatar
 
Join Date: Oct 2018
Location: SunnySandyEggo
Posts: 5,783
Thanks: 57
Thanked 1,267 Times in 1,248 Posts
theDBguy has a spectacular aura about theDBguy has a spectacular aura about
Re: Lock Fields on Form and Subform Based On One Field Value

Hi. Without looking at your database, the easiest way to lock a form is by setting the AllowEdits property to False/No. But if AllowEdits is No, then you'll need another way to modify the data to unlock the form.
__________________
Just my 2 cents...

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
theDBguy is online now   Reply With Quote
Old 06-13-2019, 12:18 PM   #3
billgyrotech
Banned
 
Join Date: Apr 2013
Posts: 258
Thanks: 67
Thanked 3 Times in 3 Posts
billgyrotech is an unknown quantity at this point
Re: Lock Fields on Form and Subform Based On One Field Value

Thanks but I was hoping for a solution.

billgyrotech is offline   Reply With Quote
Old 06-13-2019, 12:23 PM   #4
theDBguy
Iím here to help
 
theDBguy's Avatar
 
Join Date: Oct 2018
Location: SunnySandyEggo
Posts: 5,783
Thanks: 57
Thanked 1,267 Times in 1,248 Posts
theDBguy has a spectacular aura about theDBguy has a spectacular aura about
Re: Lock Fields on Form and Subform Based On One Field Value

Quote:
Originally Posted by billgyrotech View Post
Thanks but I was hoping for a solution.
Sorry, I'm not in a position to download your file at the moment. Hopefully someone else will be able to help you out. Good luck!
__________________
Just my 2 cents...

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
theDBguy is online now   Reply With Quote
Old 06-13-2019, 02:46 PM   #5
Uncle Gizmo
Nifty Access Guy
 
Uncle Gizmo's Avatar
 
Join Date: Jul 2003
Location: Newbury Berks UK
Posts: 10,310
Thanks: 537
Thanked 939 Times in 890 Posts
Uncle Gizmo is a jewel in the rough Uncle Gizmo is a jewel in the rough Uncle Gizmo is a jewel in the rough
Send a message via Skype™ to Uncle Gizmo
Re: Lock Fields on Form and Subform Based On One Field Value

I have undeleted this thread because it is a general policy of this forum that posts/threads should not be deleted, especially if someone has taken the time and trouble to answer you. The fact that you did not find the answer helpful is no reason to delete it, and at best demonstrates a certain amount of impatience on your part.

It is a very common question, how to make various form objects editable or not, so I would suggest you do a bit of searching of the forum.

Colin, (Handle isladogs) has some useful examples of this type of thing which I believe you can find on his website here:-

Set Controls

Extract:-
The attached utility demonstrates a way of setting the state of a group of controls at the same time using the controls' Tag property.

Image of Colin's Example:-




I also provide some information on my website here:- Lock, Unlock Controls >>>> and Here:- Loop Through a Set of Controls..
Attached Images
File Type: png 4634989165[1].png (77.5 KB, 160 views)
__________________
Code:
                 |||||
               @(~‘^‘~)@
-------------oOo---U---oOo-------------
|                                     |
|      Uncle Gizmo              |
|                                     |
|                                     |
| Get $20 worth of "Nifty Code"       |
|      
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
| | Ooo | |_________________ooO____( )________| ( ) ) / \ ( (_/ \_)

Last edited by Uncle Gizmo; 06-13-2019 at 02:55 PM.
Uncle Gizmo is offline   Reply With Quote
Old 06-13-2019, 03:29 PM   #6
Uncle Gizmo
Nifty Access Guy
 
Uncle Gizmo's Avatar
 
Join Date: Jul 2003
Location: Newbury Berks UK
Posts: 10,310
Thanks: 537
Thanked 939 Times in 890 Posts
Uncle Gizmo is a jewel in the rough Uncle Gizmo is a jewel in the rough Uncle Gizmo is a jewel in the rough
Send a message via Skype™ to Uncle Gizmo
Re: Lock Fields on Form and Subform Based On One Field Value

I was looking back through your threads to see if you had deleted any others, and I note that you recently had a 7-day ban. I'm wondering if that explains your preference for deleting your threads?

If you're feeling a bit tetchy because you've had a ban then, I suggest you find some other way of venting your frustration. There is a very good section of the forum called the "Water cooler" where you can get away with just about anything as long as you don't break the law. Get along there and yell and curse and shout and get it out of your system.

Alternatively watch a bit of Dr Jordan B Peterson, he has got some excellent ideas on how you can steer yourself away from going down the nihilistic route...
__________________
Code:
                 |||||
               @(~‘^‘~)@
-------------oOo---U---oOo-------------
|                                     |
|      Uncle Gizmo              |
|                                     |
|                                     |
| Get $20 worth of "Nifty Code"       |
|      
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
| | Ooo | |_________________ooO____( )________| ( ) ) / \ ( (_/ \_)
Uncle Gizmo is offline   Reply With Quote
The Following User Says Thank You to Uncle Gizmo For This Useful Post:
NauticalGent (06-14-2019)
Old 06-13-2019, 05:45 PM   #7
billgyrotech
Banned
 
Join Date: Apr 2013
Posts: 258
Thanks: 67
Thanked 3 Times in 3 Posts
billgyrotech is an unknown quantity at this point
Re: Lock Fields on Form and Subform Based On One Field Value

Too complicated for me sorry

billgyrotech is offline   Reply With Quote
Old 06-13-2019, 10:47 PM   #8
Uncle Gizmo
Nifty Access Guy
 
Uncle Gizmo's Avatar
 
Join Date: Jul 2003
Location: Newbury Berks UK
Posts: 10,310
Thanks: 537
Thanked 939 Times in 890 Posts
Uncle Gizmo is a jewel in the rough Uncle Gizmo is a jewel in the rough Uncle Gizmo is a jewel in the rough
Send a message via Skype™ to Uncle Gizmo
Re: Lock Fields on Form and Subform Based On One Field Value

Quote:
Originally Posted by billgyrotech View Post
Too complicated for me sorry
Yes, you are right it is difficult! It's always difficult learning new code, new ways to do things.

However this forum is full of people that have been through that learning process, people that have committed themselves to helping others through the same process.

if you want to learn MS Access, then these people will step in wherever they can and show you the way.

If you post your database and say "fix this", then it is unlikely you will get any help. The main reason being, if someone does the work for you, then you're not going to learn. And that's what this forum is about helping people learn how to use MS Access.

The second problem, and this is more difficult for you to grasp as a beginner, it's not easy looking at someone's database ferreting out the problem, and providing a solution. Even if the database is built along the recommended lines, and everything is functioning correctly, adding a piece of code will take at least half an hour, time that is much better spent showing the prospective database developer how to do it themselves.

Finally, the public nature of the forum, the process of you asking a question, and receiving an answer makes the knowledge available to everyone. For every person stuck and asking a question, I should imagine there are at least 10 others that solve the same problem by reading your questions and the answers given.

So don't give up, tackle it in small chunks. you could begin by creating a small sample database, extract some code from Colins example, and apply that code within your example.

Keep doing that until you run into a problem and then post the sample database along with an explanation of what you were trying to make happen and what actually happened, and then you will get some help.

Sent from my Pixel 3a using Tapatalk
__________________
Code:
                 |||||
               @(~‘^‘~)@
-------------oOo---U---oOo-------------
|                                     |
|      Uncle Gizmo              |
|                                     |
|                                     |
| Get $20 worth of "Nifty Code"       |
|      
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
| | Ooo | |_________________ooO____( )________| ( ) ) / \ ( (_/ \_)
Uncle Gizmo is offline   Reply With Quote
Old 06-13-2019, 11:04 PM   #9
Galaxiom
Super Moderator
 
Join Date: Jan 2009
Location: NSW Australia
Posts: 11,655
Thanks: 98
Thanked 1,500 Times in 1,415 Posts
Galaxiom is a splendid one to behold Galaxiom is a splendid one to behold Galaxiom is a splendid one to behold Galaxiom is a splendid one to behold Galaxiom is a splendid one to behold Galaxiom is a splendid one to behold Galaxiom is a splendid one to behold
Re: Lock Fields on Form and Subform Based On One Field Value

Quote:
Originally Posted by billgyrotech View Post
Too complicated for me sorry
I would suggest you consider another line of work if you think this simple task is too difficult to attempt yourself. You won't learn anything by getting someone to do it for you. Nor will it bring you real job satisfaction.

Although we do sometimes write code for people, the main purpose of this forum is to share knowledge and instill understanding. When I rarely do write code is when it is an interesting challenge or I have a purpose for it for my own work.

Complaining that you didn't instantly get what you wanted handed to you on a plate is a really quick way to eventually get ignored. Don't forget we are all volunteers here.
Galaxiom is offline   Reply With Quote
Old 06-14-2019, 01:44 AM   #10
billgyrotech
Banned
 
Join Date: Apr 2013
Posts: 258
Thanks: 67
Thanked 3 Times in 3 Posts
billgyrotech is an unknown quantity at this point
Re: Lock Fields on Form and Subform Based On One Field Value

So far I have been criticized for not being able to post a proper question and this last one giving me advice to change my line of work.


I have managed to make a database that has been working for the last 5 years. I am just trying to improve the system by asking so-called experts on here.


I believe at this point I will not receive any easy guidance. If I were in the position of helping others on here that are in apparent need I would be more patient. However this is not the case and it seems that it's best that I learn on my own how to improve my system.
billgyrotech is offline   Reply With Quote
Old 06-14-2019, 01:29 PM   #11
Vassago
Administrator
 
Join Date: Dec 2002
Location: Jacksonville, FL
Posts: 4,360
Thanks: 82
Thanked 95 Times in 89 Posts
Vassago has a spectacular aura about Vassago has a spectacular aura about Vassago has a spectacular aura about
Re: Lock Fields on Form and Subform Based On One Field Value

You didn't ask for guidance. You only stated it was too complicated for you. So ask for guidance! What part is too complicated? Did you look at the design and come up with questions? That's a better way to seek help than "Thanks but I was hoping for a solution."

We are here to guide you to the answer you seek, but not do it for you, as others have already stated. People here are happy to help guide you, but generally will ignore you if you are unwilling to take another step on your own and come back with questions.
__________________
Vassago
Vassago is offline   Reply With Quote
Old 06-15-2019, 12:36 AM   #12
Gasman
Enthusiastic Amateur
 
Gasman's Avatar
 
Join Date: Sep 2011
Location: Swansea, South Wales,UK
Posts: 4,343
Thanks: 432
Thanked 795 Times in 770 Posts
Gasman is a jewel in the rough Gasman is a jewel in the rough Gasman is a jewel in the rough
Re: Lock Fields on Form and Subform Based On One Field Value

Quote:
Originally Posted by billgyrotech View Post
I have managed to make a database that has been working for the last 5 years. I am just trying to improve the system by asking so-called experts on here.
I am in the same position that you are in. I have in the past created some DBs for use in work, that worked fine thanks to assistance from here, but now out of work, still use Access for my charity work and my own personal uses.

I have received assistance on here since 2011 for those DBs' and still get it when I ask.?

I take on board what you so insolently call 'so-called 'experts' advice when I post. I also take on board what they post for others.
Sometimes it has not been what I wanted to hear as I was too far down a certain path with structure being logically incorrect, but I still appreciated their input. After all why bother asking if you are not going to listen.?

That input was incorporated in future projects when required so I did not make the same mistake twice. I try to learn by my mistakes.

You appear to have a huge chip on your shoulder? If you were to leave it at the keyboard and try an treat others as you would wish to be treated, I am sure you would benefit greatly from this site.

However it is up to you.?
__________________
Access novice. Sometimes trying to give something back.
Access 2007

Please, please use code tag # when posting code snippets

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Gasman is offline   Reply With Quote
Old 06-15-2019, 02:22 AM   #13
billgyrotech
Banned
 
Join Date: Apr 2013
Posts: 258
Thanks: 67
Thanked 3 Times in 3 Posts
billgyrotech is an unknown quantity at this point
Re: Lock Fields on Form and Subform Based On One Field Value

Hello,


I humbly ask for your help please. I have a form AFRs that I would like the ability to close all fields for editing including the subform AFRsParts for the records that have "Closed" in the Status field. Does anyone know how to go about doing this?


Thank you kindly,
Bill

Last edited by billgyrotech; 06-18-2019 at 12:33 PM.
billgyrotech is offline   Reply With Quote
Old 06-15-2019, 02:51 AM   #14
Gasman
Enthusiastic Amateur
 
Gasman's Avatar
 
Join Date: Sep 2011
Location: Swansea, South Wales,UK
Posts: 4,343
Thanks: 432
Thanked 795 Times in 770 Posts
Gasman is a jewel in the rough Gasman is a jewel in the rough Gasman is a jewel in the rough
Re: Lock Fields on Form and Subform Based On One Field Value

I *think* the easiest way would be to disable AllowEdits for the form and subform

Place the code in the current event of the main form checking the Status control
Bear in mind I am not an expert, so the syntax might not be perfect for the subform?

Code:
Me.AllowEdits = Me.Status <> "Closed"
Me.SubFormControl.Form.AllowsEdits = Me.Status <> "Closed"
HTH
__________________
Access novice. Sometimes trying to give something back.
Access 2007

Please, please use code tag # when posting code snippets

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Gasman is offline   Reply With Quote
Old 06-15-2019, 03:15 AM   #15
billgyrotech
Banned
 
Join Date: Apr 2013
Posts: 258
Thanks: 67
Thanked 3 Times in 3 Posts
billgyrotech is an unknown quantity at this point
Re: Lock Fields on Form and Subform Based On One Field Value

Thanks I will give it a try.

billgyrotech is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
lock field in record based on input from another field murray83 Modules & VBA 4 06-10-2017 09:52 AM
need to lock button based on subform HRakibul Forms 12 09-02-2014 11:20 AM
disable / lock fields on form & subform based on checkbox fibayne Forms 7 02-16-2014 02:09 PM
lock a field on main form if a field on a subform is complete? KevinSlater Forms 4 10-26-2005 12:00 PM




All times are GMT -8. The time now is 08:19 PM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World