Disabling a control after entering data

chrisroy1972

New member
Local time
Today, 10:27
Joined
Jun 30, 2014
Messages
5
Hi everyone,

I know some basic code to disable a control after updating but, I have 20 or so controls that I want that to happen to as the record is updated over time. Is there a way to group all those controls and have them evaluated after going dirty instead of having to code each control?

Oh, and I would like the controls to become enabled if no data is present. Any help would really be great.

chris
 
You could use a loop of all controls and have something in the Tag property of those 20 to identify them. Then put your code inside a test of the Tag property inside the loop.
 
Thank you. would you be able to give me an example of the code to write? I would really appreciate that.

chris
 
Dim ctrl

For each ctrl in me.Controls
If ctrl.Tag = "disableCtrl" then
Ctrl.Enabled = False
Next ctrl
 
Dim ctrl

For each ctrl in me.Controls
If ctrl.Tag = "disableCtrl" then
Ctrl.Enabled = False
Next ctrl

You would add to that a test for a value in the control, and enable/disable as appropriate.
 

Users who are viewing this thread

Back
Top Bottom