ComboBox .locked=True causes Enabled

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.
 
K

Klatuu

If a controls properties are set to Locked = True and Enabled = False, it
will appear norma (not greyed out), but cannot be edited.
 
P

Pat

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?
 
K

Klatuu

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.
 
P

Pat

Ok, I added a check in this sub to see if the checkbox is true and then set
the .locked. It works ....
 
K

Klatuu

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 ....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top