469,323 Members | 1,575 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,323 developers. It's quick & easy.

Avoid typing text in a combobox?

lk
Hi there,

is it possible to avoid that a user could enter a text directly in a
combobox?

The user should only select a text from the list of the combobox without
typing anything.

Thanks

LuKe
Nov 13 '05 #1
5 11192
Set the combobox's LimitToList property to True. They'll still be able to
type, but their typing won't be accepted unless it's in the list.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

"lk" <ce**********@email.it> wrote in message
news:3a*************@individual.net...
Hi there,

is it possible to avoid that a user could enter a text directly in a
combobox?

The user should only select a text from the list of the combobox without
typing anything.

Thanks

LuKe

Nov 13 '05 #2
lk
Douglas J. Steele wrote:
Set the combobox's LimitToList property to True. They'll still be able to
type, but their typing won't be accepted unless it's in the list.

Thanks for your answer.

I have already used that property.
But the problem is just the alert message.

I want to avoid the user could type in the combobox.

ByE

LuKe
Nov 13 '05 #3
This would be one method. Add to the list of allowed keys as needed.

Private Sub Combo0_KeyDown(KeyCode As Integer, Shift As Integer)
Select Case KeyCode
Case vbKeyTab, vbKeyEscape, vbKeyReturn
Case Else
KeyCode = 0
End Select
End Sub

Setting the KeyCode to 0 cancels the key entry.

--
Wayne Morgan
MS Access MVP
"lk" <ce**********@email.it> wrote in message
news:3a*************@individual.net...
Douglas J. Steele wrote:
Set the combobox's LimitToList property to True. They'll still be able to
type, but their typing won't be accepted unless it's in the list.

Thanks for your answer.

I have already used that property.
But the problem is just the alert message.

I want to avoid the user could type in the combobox.

ByE

LuKe

Nov 13 '05 #4
lk
Wayne Morgan wrote:
This would be one method. Add to the list of allowed keys as needed.

Private Sub Combo0_KeyDown(KeyCode As Integer, Shift As Integer)
Select Case KeyCode
Case vbKeyTab, vbKeyEscape, vbKeyReturn
Case Else
KeyCode = 0
End Select
End Sub

Setting the KeyCode to 0 cancels the key entry.

THANKS!!!!!
LuKe
Nov 13 '05 #5
hi,

Private Sub YOURCombo_NotInList(NewData As String, Response As Integer)
Response = False
End Sub

bye,
ste

lk <ce**********@email.it> wrote in message news:<3a*************@individual.net>...
Douglas J. Steele wrote:
Set the combobox's LimitToList property to True. They'll still be able to
type, but their typing won't be accepted unless it's in the list.

Thanks for your answer.

I have already used that property.
But the problem is just the alert message.

I want to avoid the user could type in the combobox.

ByE

LuKe

Nov 13 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Tor Inge Rislaa | last post: by
3 posts views Thread by Mark P | last post: by
2 posts views Thread by Pepi Tonas | last post: by
4 posts views Thread by Vish | last post: by
1 post views Thread by Simon | last post: by
2 posts views Thread by =?Utf-8?B?UmFqbmVlc2ggTmFyYWlu?= | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by mdpf | last post: by
reply views Thread by harlem98 | last post: by
reply views Thread by listenups61195 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.