Selectable but not editable Combo box

C

cjbones

I have a form which contains multiple combo boxes. I would like users to be
able to select, but not be able edit/ change the choices displayed by these
combo boxes.
Does anyone know of a way to accomplish this ?
 
M

Marshall Barton

cjbones said:
I have a form which contains multiple combo boxes. I would like users to be
able to select, but not be able edit/ change the choices displayed by these
combo boxes.


You can set the combo box's Limit To List property to Yes.
 
P

Paul Shapiro

Not sure what you mean here, but on the combo box properties, set Enabled to
Yes and Locked to Yes. This lets users put the cursor into the combo box,
but they cannot change the selected data value.
 
J

John W. Vinson

I have a form which contains multiple combo boxes. I would like users to be
able to select, but not be able edit/ change the choices displayed by these
combo boxes.
Does anyone know of a way to accomplish this ?

Set each such combo's Limit to List property to Yes.
 
C

cjbones

Hi,

Thanks for your reply.

I tried setting both enabled and locked to yes but then the user can no
longer select from the combo box list. I would like the user to continue to
select from the list but not be able to delete the text that appears in the
combo box for example. Right now they can select or change values already
selected. But they can also edit the displayed text in the combo box. Hope
this explains my problem.
 
C

cjbones

Hi,

Thanks for your reply.

Tried setting the limit to list property but this did not help.

I tried setting both enabled and locked to yes but then the user can no
longer select from the combo box list. I would like the user to continue to
select from the list but not be able to delete the text that appears in the
combo box for example. Right now they can select or change values already
selected. But they can also edit the displayed text in the combo box. Hope
this explains my problem.
 
S

Stuart McCall

cjbones said:
Hi,

Thanks for your reply.

I tried setting both enabled and locked to yes but then the user can no
longer select from the combo box list. I would like the user to continue
to
select from the list but not be able to delete the text that appears in
the
combo box for example. Right now they can select or change values already
selected. But they can also edit the displayed text in the combo box. Hope
this explains my problem.

Put the following code in the combo's KeyPress event:

KeyAscii = 0

What this does is to 'throw away' any keypresses from the combo's textbox.
However, this doesn't affect the combo's 'controlling' keypresses. The user
can still drop down the list with Alt-Down Arrow, and may still scroll up &
down and make selection with the Return/Enter key. They just can't type into
the text portion or delete from it.

HTH
 
C

cjbones

Stuart McCall said:
Put the following code in the combo's KeyPress event:

KeyAscii = 0

What this does is to 'throw away' any keypresses from the combo's textbox.
However, this doesn't affect the combo's 'controlling' keypresses. The user
can still drop down the list with Alt-Down Arrow, and may still scroll up &
down and make selection with the Return/Enter key. They just can't type into
the text portion or delete from it.

HTH

Thanks alot.
I tried your suggestion and it worked !
I've been searching for a solution for a while now, thanks again for your
help.

CJBones.
 

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