473,406 Members | 2,745 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

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 12074
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Tor Inge Rislaa | last post by:
Avoid autoselect in combobox In the load procedure of a form I am filling a combobox with data from a database. The combobox fill the data OK, but it is automatic showing the first item of the...
3
by: Mark P | last post by:
How to solve this? 1. Place a ComboBox in a form 2. On the ComboBox Properties window change the Items to hold: a b c d
2
by: Pepi Tonas | last post by:
I am using a combobox in an application, where I don't want the text to be changed, limiting the displayed text to those assigned to each item in the control's item collection. I don't want to...
4
by: Vish | last post by:
Hi, I need to make the text on a combobox that is disabled to be drawn with a black color. I was not able to find any help on this online. The drawItem seems to apply only for the dropdpwn...
5
by: CCLeasing | last post by:
Hello, I have searched google but can not find a straight forward answer to my problem. Hopefuly someone will be kind enough to offer their expertise. Please forgive if this seems a bit convoluted...
16
by: John U. | last post by:
Hi Group, Here is a common problem: I have many (100) links on a web page, all pointing to different pages on the same domain (e.g., "http:// www.x12345.com/"). This is a bother because (1)...
1
by: Simon | last post by:
Dear reader, One of the properties of a field is "Auto expand". Is this the property to able and unable the expend by typing. My experience with "Expend by typing" in a combobox is not...
3
by: Simon van Beek | last post by:
Dear reader, What can be wrong in my ComboBox, the property "Auto Expand" is set to Yes, but by typing in the ComboBox it doesn't expand. Is this because the source of the ComboBox is a...
2
by: =?Utf-8?B?UmFqbmVlc2ggTmFyYWlu?= | last post by:
Hi, I have a ComboBox in a Windows app (.net2.0). And when users start typing into it, the dropdown populates itself from a webservice and gives relevant options under it... But the mouse hides...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.