473,563 Members | 2,445 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 12098
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**********@e mail.it> wrote in message
news:3a******** *****@individua l.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**********@e mail.it> wrote in message
news:3a******** *****@individua l.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_NotIn List(NewData As String, Response As Integer)
Response = False
End Sub

bye,
ste

lk <ce**********@e mail.it> wrote in message news:<3a******* ******@individu al.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
3272
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 list as the text. How can I avoid the first item in the list to be selected as default? I want the textbox of the combo to be left empty until the...
3
2535
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
1733
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 allow users to type in anything into the control's textbox and limit them to only be able to choose from its list. Thanks...
4
5536
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 items. Any ideas or sugesstions would be appreciated. Thank you,
5
2846
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 but this is probabally a reflection of my not clear understanding of the mechanics behind what i'm trying to achieve. Please bear with it I really...
16
2562
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) it takes a lot of typing, and (2) more importantly, if (or when) the main URL changes, it takes a lot of work to update the links.
1
1537
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 so good.
3
17229
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 query.
2
3723
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 itself, os its very hard to know what you are selecting. The reason for mouse hiding itself is because in Control Panel >Mouse >> Pointer Options...
0
7658
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7579
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7876
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7630
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6235
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5201
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3628
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2077
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1194
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.