Db-why-not
Registered User.
- Local time
- Today, 05:47
- Joined
- Sep 17, 2019
- Messages
- 159
Hello,
I want to create a button that locks individual records in my database on the forms, so accidental edits don't happen. I used the code and followed the instructions from this website http://allenbrowne.com/ser-56.html.
The code does work, but it either locks all the records or unlocks all the records, not just individual records. You have to click the button to unlock or lock every time. The way I have my forms set up. I have buttons that open up subforms in a subform container. The subforms don't lock/unlock automatically when they open/load from the Main form. I have to press the unlock button to change each subform that I open. I tried putting this code =LockBoundControls([Form],True) on the On Load setting for each subform. Then every subform that is opened is always locked when it first loads in the subform container.
I want each subform to open locked if the locked button is selected or open unlocked if the unlocked button is selected. I want each individual record when it is pulled up to already be locked or unlocked when I scroll through all my records on my forms. I made a field called Locked_Record in one of my New_Patients tables that is a YES/NO field. I want to use this field to determine if my forms will be locked or unlocked depending on what record is being viewed in my forms.
I have different lookup fields on my main form that cannot be locked, the code I was using was working with those fields.
Can I modify the code I am using from the http://allenbrowne.com/ser-56.html. website or do I need to use completely different code to get the function that I want? Thank you.
I want to create a button that locks individual records in my database on the forms, so accidental edits don't happen. I used the code and followed the instructions from this website http://allenbrowne.com/ser-56.html.
The code does work, but it either locks all the records or unlocks all the records, not just individual records. You have to click the button to unlock or lock every time. The way I have my forms set up. I have buttons that open up subforms in a subform container. The subforms don't lock/unlock automatically when they open/load from the Main form. I have to press the unlock button to change each subform that I open. I tried putting this code =LockBoundControls([Form],True) on the On Load setting for each subform. Then every subform that is opened is always locked when it first loads in the subform container.
I want each subform to open locked if the locked button is selected or open unlocked if the unlocked button is selected. I want each individual record when it is pulled up to already be locked or unlocked when I scroll through all my records on my forms. I made a field called Locked_Record in one of my New_Patients tables that is a YES/NO field. I want to use this field to determine if my forms will be locked or unlocked depending on what record is being viewed in my forms.
I have different lookup fields on my main form that cannot be locked, the code I was using was working with those fields.
Can I modify the code I am using from the http://allenbrowne.com/ser-56.html. website or do I need to use completely different code to get the function that I want? Thank you.