Results 1 to 2 of 2
2007-05-04, 03:59 #1
- Join Date
- May 2002
- Patagonia Region Chile
- Thanked 0 Times in 0 Posts
Conditional enable =false in subform (a2k)
Dear HANS and others.
Hello...Thank you for the wisdom.
Been working on this for awhile. Main form is a piece an item to be manufactured. Subform contains steps. Once the step is has the complete check box checked.. Id like to set enable=to false for that record. I tried with a looping function that goes though all conrtols and sets them to enable = false... NO LUCK with that. not sure why. Finally just went with the BEForeUpDATE event and put each control name in by hand and set it to enabled = False based on an if then of the completing check box....
this works but all the records on the subform then have their controls DISABLED also .. This was not my intention.
My intention was to make it very hard to come back and change records that have been registered as COMPLETE becuase that is when we reconcile records and payment etc... (If you really had to edit the record, I had one check box which got set to TRUE by checking the complete checkbox but remains ENABLED so that you could to which you could scroll way right find it and UNcheck it making all the other controls ENABLEd also allowing editing....This system avoids accidental edits to a closed record which we were seeing a lot of as folks were going to edit nearby records.) Being able to see all the records at once is important.. so filtering COMPLETE items is great solution for us.
The uncomplete items still need to be editable.
So I used an ONcurrent even which works nicely but since it is a a data sheet it is very confusing to have the whole thing go ENABLED then DISABLED depending on which record you click.
So I changed it to a continuous form sub form thinking that would make it behave diferently. It did not.
So ... HOW then may we make a given record unedtable...or very hard to edit... thanks very much HANS.
2007-05-04, 05:32 #2
- Join Date
- Mar 2002
- Thanked 28 Times in 28 Posts
Re: Conditional enable =false in subform (a2k)
Instead of setting Enabled to No, I'd set the Locked property of the controls to Yes in the On Current event of the subform if the item has been completed. It will still affect all records, but it doesn't have the same visual impact.