Quote:
Originally Posted by jmartmem
...I want to lock the value in cboStatus following the AfterUpdate procedure to the option group. This is because I don't want someone to go back and change the status to its original setting after a date change..
Hi. You could use the On Current event of your Project Update form to toggle the controls you don't wish to have updated to enabled=false and locked=true based on a condition testing the value of your status field (and any others you choose). Skeleton code for this in your On Current event is just
-
-
Dim LockConditionMet as Boolean
-
LockConditionMet = (specify the condition to be tested to determine whether to lock the values; condition true = lock, false = allow updates)
-
me.firstcontrol.enabled = Not LockConditionMet
-
me.firstcontrol.locked = LockConditionMet
-
me.secondcontrol.enabled = Not LockConditionMet
-
me.secondcontrol.locked = LockConditionMet
-
etc
-
On Current is a record-level event that is fired each time you move from one record to another.
You would also call the On Current event in your After Update event, so that after a user updates values on your form the condition is tested to toggle controls on or off.
This will not prevent changes to individual values at table level if users have access to the underlying tables, however.
-Stewart