Not allow to type in Combox Box

E

Eddy

The standard Combo box allow user to type or select from list.

I would like to not allow the user "type" on the combo box. Which property
should I set? or I need to code?

Thanks
Eddy
 
M

missinglinq via AccessMonster.com

Sorry, Bruce, setting the Limit to List property to Yes will not prevent the
user from typing in the combobox, it will just throw an error message if the
user types in something that is not in the list! This bit of code will do
the job, while still allowing selection form the control:

Private Sub YourComboBoxName_KeyDown(KeyCode As Integer, Shift As Integer)
KeyCode = 0
End Sub
 
J

Jeff Boyce

Eddy

That depends on your definition of "type"...

When I present a combo box to my users, I try to give them more than one way
to select an item from the combo box list. One way certainly is clicking
the drop-down arrow, scrolling until they find an item, then hitting
<Enter>.

Another way is to allow them to begin typing and have Access go to the first
item in the list that starts out with the characters they've typed (so far).
This can help them narrow down their search for an item.

How are you defining "type"?

--
Regards

Jeff Boyce
www.InformationFutures.net

Microsoft Office/Access MVP


Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/
 
B

BruceM

I did not take the question to mean the OP wished to prevent people from
typing anything at all, and therefore force them to use the drop-down list
rather than AutoExpand, although that may have been the intention.
 
E

Eddy

Thanks all,

I think I got the answer from missinglinq.
Sorry for not well define the question.

Eddy
 
M

missinglinq via AccessMonster.com

I think Eddy was pretty clear in his post:

"The standard Combo box allow user to type or select from list. I would like
to not allow the user "type" on the combo box"

"How are you defining "type"?"

You know, you press a key on the keyboard, the corresponding letter shows up
on the screen. You know, "typing!"
 
B

BruceM

There really was no need for sarcasm. The OP could very well have meant he
doesn't want the users to type an entry that is not in the list. Some
people like to use the keyboard, and some like to click. Many developers
will make either option possible. The OP wants to force users to use the
drop-down, even though it makes no difference in terms of what ends up in
the table.
 
J

Jeff Boyce

Bruce

I take a lot of care to make sure my intent is clear. If I'm making a joke,
I add a <g> grin. If I'm trying to be sarcastic, I add <sarcasm>.

It's quite easy to mis-interpret intent when we are relying solely on the
written word, and don't have visual or auditory clues to help clarify.

I was absolutely serious in making sure that the OP and I were sharing a
common definition of the word "type".

Are you quite certain you have correctly interpreted the OP's intent?

By the way, you and I just said about the same thing ... different users are
comfortable with different approaches to data entry/edit. We both appear to
understand that and offer multiple paths to getting the same job done.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
B

BruceM

I was responding to missinglinq's remark that the OP was perfectly clear,
and that "type" can only mean one thing. "You know, 'typing'" is the part
that struck me as sarcastic, although admittedly it was rather mild.
My original posting was based on another assumption that I think was valid
enough based on the original posting. Your questions in your initial reply
sought clarification, since the question could reasonably have been taken
two ways..
Apparently the OP's intention was to force the users to select from the
combo box, since it seems that using KeyCode = 0 in the Key Down event was
the choice. Not the choice I would have made, for the user-preference
reasons I mentioned (as did you).
 
Top