Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

combobox: list only

Status
Not open for further replies.

JeroenNL

Programmer
Nov 28, 2002
217
0
0
NL
Hi there,

I would like to have a combobox on one of my forms in which I can only select a value by using the mouse. In other words, no typing at all in the combobox. I know this can be done by using a listbox but I would really like a combobox instead. Is this possible?

Thanks,
Jeroen
 
May I ask why you want to prevent typing?

If it is because you don't the user to accidentally type something that isn't in the list, you can set the limit to list property to "yes". Maq [americanflag]
<insert witty signature here>
 
Hi Jeroen!

One possible way would be to add this to the KeyUp Event:

Me!YourComboBox.Text = &quot;&quot;

hth
Jeff Bridgham
bridgham@purdue.edu
 
The reason I want to do this: the values in the combo are the only possible options + a combobox doesn't require a lot of space on the screen. When I click the combobox, it collapses and shows, for example, 8 rows of data I can click. That's convinient because I can immidiately point and click the one row I want. With a listbox, I can achieve the same thing but a listbox requires more space on the screen if I want 8 rows of data.

I'm used to programming in Delphi and the Delphi combobox has an option to not let the user enter text. That has an additional advantage... I can click the entire combobox (so also in the textspace) and it will collapse. Seems the Access combobox is a bit more primitive. But I can use the Limit To List property also. Thanks. :)

Bye,
Jeroen
 
There's another current post with the exact same subject. I want to add, from a programmer's or administrator's perspective, it may be all fine and dandy requiring point and clicking...

But from a user's perspective, using the mouse really slows down the data entry process, and many prefer to type in the value for speed and ease of use.

About the only reason I can think of for disabling the typing is if you want to force the user to view all the possible choices before selecting. Other than that, new software should never be an inconvenience for the user.
 
I also don't want the user to be able to add data and only select from a combo list... I have set the the limit the list to yes....do I have to rebuild the form to inable this option?
 
if you set the limit to list to true the user can type something in the textpart of the combobox this then gives the first value of the corresponding items. If the user then tries to type something that is not in the list the not in list event will trigger. if nothing is in this event access will tell the user that the value typed is not in the list and will therefor not be accepted. if you do set something in the not in list event you can give yout own error message. Christiaan Baes
Belgium
&quot;What a wonderfull world&quot; - Louis armstrong
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top