how to disable or lock a combobox

  • Thread starter Thread starter JS
  • Start date Start date
J

JS

I would like to disable nearly a whole form because of
right restrictions depending on who is logged in.
How can I disable or lock a combobox?

me!mybox.Locked = True does not function
me!mybox.Enabled = False does not function

only with normal fields it is possible to use these
properties, is that correct? has anybody a hint?
Thanks a lot for helping
 
Hi JS,

Either of those should work. When the combo is locked and enabled, the combo
will still drop down but you can't select anything or change the current
value. If it is not locked and not enabled, the combo is greyed and cannot
receive focus. If it is locked but not enabled it is not greyed out but
still can not receive focus and can not be dropped down.

If your code is not working is it possible that you have code running later
which undoes the locking?
 
Thanks a lot for the answer, I think I didnt describe my
problem well.

both lines quit with the error 438 (german release of
ACCESS 2000) that the method is not supported with this object.

with a normal textfield in the same form at the same time
locked or disabled there is no errormessage.
-----Original Message-----
Hi JS,

Either of those should work. When the combo is locked and enabled, the combo
will still drop down but you can't select anything or change the current
value. If it is not locked and not enabled, the combo is greyed and cannot
receive focus. If it is locked but not enabled it is not greyed out but
still can not receive focus and can not be dropped down.

If your code is not working is it possible that you have code running later
which undoes the locking?


--
Sandra Daigle [Microsoft Access MVP]
Please post all replies to the newsgroup.

I would like to disable nearly a whole form because of
right restrictions depending on who is logged in.
How can I disable or lock a combobox?

me!mybox.Locked = True does not function
me!mybox.Enabled = False does not function

only with normal fields it is possible to use these
properties, is that correct? has anybody a hint?
Thanks a lot for helping


.
 
Hi JS,

Are you sure that the control is named "mybox"? Check the name property of
the control by selecting the control then look under the other tab. It's
easy to create a control, then change the field it's bound to and forget to
rename the control. If that is the case, then perhaps "mybox" is referring
to a field in the underlying recordset.
 
Dear Sandra,
of course you are right. I did not use the names of the
boxes but the names of the fields. Now everthings
functions. Next time I will check better.
Thanks a lot
JS
-----Original Message-----
Hi JS,

Are you sure that the control is named "mybox"? Check the name property of
the control by selecting the control then look under the other tab. It's
easy to create a control, then change the field it's bound to and forget to
rename the control. If that is the case, then perhaps "mybox" is referring
to a field in the underlying recordset.

--
Sandra Daigle
[Microsoft Access MVP]
For the benefit of others please post all replies to this newsgroup.
Thanks a lot for the answer, I think I didnt describe my
problem well.

both lines quit with the error 438 (german release of
ACCESS 2000) that the method is not supported with this object.

with a normal textfield in the same form at the same time
locked or disabled there is no errormessage.

.
 
Back
Top