ComboBox .locked=True causes Enabled

  • Thread starter Thread starter Pat
  • Start date Start date
P

Pat

That was a little cryptic, but the problem is this. I have a form with a
combobox (optics) where the .enabled is set to false if a checkbox
(optics_yn) is not selected.

Me.optics.Enabled = Me.optics_yn.value

The problem is when the user selects to lock all the fields me.optics.locked
= true the combobox now appears to be enabled. However while debugging this
the value of the optics.locked is still false.

Any suggestions? BTW I am using MS Access 2003.
 
If a controls properties are set to Locked = True and Enabled = False, it
will appear norma (not greyed out), but cannot be edited.
 
That's not what is happening. I have a sub that I call that will either
enable or disable the control. The control basiclock is a checkbox control
the user selects to lock the controls. When I step through it with the
debugger, the status is as follows

basiclock = True
optics.locked is False
optics.enabled is False.

When this line is run Me.optics.Locked = basiclock the value of .locked
is now true and .enabled is false. However the form now has the control set
to the normal (non-greyed) color.

All controls on the form are locked, but none of them are ever disabled so I
can't test against another control.

Any suggestions I can try?
 
When this line is run Me.optics.Locked = basiclock the value of .locked
is now true and .enabled is false. However the form now has the control set
to the normal (non-greyed) color.

That is exactly what I said would happen.
If locked = false and enabled = false, it will be greyed out
If locked - true and eanbled = false, it will appear normal.
 
Ok, I added a check in this sub to see if the checkbox is true and then set
the .locked. It works ....
 
Great.
--
Dave Hargis, Microsoft Access MVP


Pat said:
Ok, I added a check in this sub to see if the checkbox is true and then set
the .locked. It works ....
 
Back
Top