(hopefully) straightforward code query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

In a single record (ie not continuous) form I have four fields that are
disabled using the "on current" event.

I would like to enable all four fields when I choose either of two options
out of four in another combo box. I.e. If the options were A,B,C,D then
choosing either A or B would enable the four fields.

I could string out the code but there must be a straightforward and simple
way of doing it.

Cheers.
 
The normal way I do this is in the AfterUpdate event of the combo box. It
would look something like:

Private sub yourCombo_AfterUpdate

Dim bEnabled as boolean

bEnabled = (me.yourCombo = "A") OR (me.yourCombo = "B")
me.control1.enabled = bEnabled
me.control2.enabled = bEnabled
me.control3.enabled = bEnabled
me.control4.enabled = bEnabled

End sub

HTH
Dale
 
Cheers.



Dale Fye said:
The normal way I do this is in the AfterUpdate event of the combo box. It
would look something like:

Private sub yourCombo_AfterUpdate

Dim bEnabled as boolean

bEnabled = (me.yourCombo = "A") OR (me.yourCombo = "B")
me.control1.enabled = bEnabled
me.control2.enabled = bEnabled
me.control3.enabled = bEnabled
me.control4.enabled = bEnabled

End sub

HTH
Dale
 
Back
Top