G
Guest
I'm trying to disable access to a particular field until data is entered into
3 others first. I have been unable to adapt the solution to a similar
problem (where only one field requires entry to enable several others) posted
by Nikos Yannacopoulos:
---
Assuming the combo name is cboUser and the other four controls are named
ctrl1 through ctrl4 (and you change the control names to the actual ones),
use the combo's Before Update event to run the following code:
Dim cboStatus As Boolean
cboStatus = IsNull(Me.cboUser)
Me.ctrl1.Enabled = Not cboStatus
Me.ctrl2.Enabled = Not cboStatus
Me.ctrl3.Enabled = Not cboStatus
Me.ctrl4.Enabled = Not cboStatus
The Enabled property of the four controls should be set to No in the form
design, so they are not enabled when the form opens. Alternatively, you
could run the exact same code in the form's On Open event
3 others first. I have been unable to adapt the solution to a similar
problem (where only one field requires entry to enable several others) posted
by Nikos Yannacopoulos:
---
Assuming the combo name is cboUser and the other four controls are named
ctrl1 through ctrl4 (and you change the control names to the actual ones),
use the combo's Before Update event to run the following code:
Dim cboStatus As Boolean
cboStatus = IsNull(Me.cboUser)
Me.ctrl1.Enabled = Not cboStatus
Me.ctrl2.Enabled = Not cboStatus
Me.ctrl3.Enabled = Not cboStatus
Me.ctrl4.Enabled = Not cboStatus
The Enabled property of the four controls should be set to No in the form
design, so they are not enabled when the form opens. Alternatively, you
could run the exact same code in the form's On Open event