Logo 
Search:

MS Office Forum

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds

Drop down lists

  Asked By: Cesar    Date: Jan 31    Category: MS Office    Views: 881
  

I am attempting to restrict the user to select one from a drop down list on a
form. The user should not be able type anything else - only select from the drop
down list.

How do I do this?

Share: 

 

17 Answers Found

 
Answer #1    Answered By: Heru Chalthoum     Answered On: Jan 31

Set the ShowModal property of the form to True.

 
Answer #2    Answered By: Murad Bashara     Answered On: Jan 31

Instead of using the combo box fromt the control toolbox, try to use the combo
box from the forms toolbar. That will prevent anyone from writing in the drop
down list.

 
Answer #3    Answered By: Juan Reynolds     Answered On: Jan 31

Instead of using the combo box fromt the control toolbox, try to use the combo
box from the forms toolbar. That will prevent anyone from writing in the drop
down list.

 
Answer #4    Answered By: Rafael Thompson     Answered On: Jan 31

Or in the properties set MatchEntry to 2 - fmMatchEntryNone
I just tried it and it works.

 
Answer #5    Answered By: Helga Miller     Answered On: Jan 31

Setting frmMatchEntry to 2 still allows the user  to type  in the drop
down list.

I am unable to find the the Forms Toolbar in the VBE. I am aware it
exists in the worksheet. My requirement is to have the combo box on
a user form in the VBE.

 
Answer #6    Answered By: Willard Washington     Answered On: Jan 31

This is an option in the properties window which (I beleive says) Limit To List
... check Yes or True and they can only select  what you have in the list.

 
Answer #7    Answered By: Emily Brown     Answered On: Jan 31

in the Properties Window select  "MatchRequired = True"

 
Answer #8    Answered By: Jarrod Williams     Answered On: Jan 31

Even if you set match required = true, I found that in the combo
box, you are still able to type  in a value that is not in the list.
Yes admittedly it will throw up an error, but I would like the
situation such that the user  is only able to select  from the list
and nothing else.

 
Answer #9    Answered By: Evelyn Hughes     Answered On: Jan 31

>I appreciate all the suggestions and help the various users have offered
but I seem to conclude that it may not be
>possible for a combo box to function like a calendar control (i.e. quite
simply, for the user  to click on the down
> arrow and select  from the list). I am aware this can be done quite easily
in ACCESS by using the LimitToList >
>property of the combo box). If any one has a simple solution that works
exactly like the combo box in
>ACCESS, it would be welcomed.

Just a minute... Don't give up yet.

I believe that using "MatchRequired" in Excel is the same as the way an
ACCESS combo box works with "LimitToList".

> Even if you set match required = true, I found that in the
> combo box, you are still able to type  in a value that is not
> in the list.
> Yes admittedly it will throw up an error, but I would like
> the situation such that the user is only able to select from
> the list  and nothing else.

Using LimittoList in Access also allows you to type in entries not in the
list.

What *exactly* have you seen as a difference when you do what Moses???

 
Answer #10    Answered By: Douglas Sullivan     Answered On: Jan 31

My apologies, I read that LimitToList = yes restricts the user  to
selecting only from the drop  down list. After your message, I have
just tried the combo box in ACCESS and you are right that it
functions the same as MatchRequired = True.

I am now asking how does one get the combo box to function like a
drop down list  such that the user is completely restricted to make a
selection only from the drop down list.

 
Answer #11    Answered By: Cambria Lopez     Answered On: Jan 31

The best bet for you would be to put a text box which is disabled. Put a
button which has an image to look like the button from the combobox to the
right of the text box. Then on top of the text box put a list  box which has
visible=false. When the arrow is clicked make the list box visible=true then
when the selection is made in the list box make the text box value = the list
box selection.value and make the text box visible=false

 
Answer #12    Answered By: Topaz Ramirez     Answered On: Jan 31

A couple of points. Where can I find a button that looks like a
combo box button and secondly, in the last line of your suggested
solution, you say make the text box visible=false. Do you mean that
the list  box visible = false?

 
Answer #13    Answered By: Angie Bennett     Answered On: Jan 31

To get the image you could do a screen copy and paste into paint, then cut the
relevant square to a file. You would then use that file for the image
property of the command button.

And. Yes! I apologise. I did mean make the list  box disappear.

I hope this all helps.

 
Answer #14    Answered By: Ray Lawrence     Answered On: Jan 31

You could always try putting code behind the change event for the combo box.
The code would check through the drop  down list  for similar text. As there
are only 31 entries max for drop down list the overhead would be negligable.

 
Answer #15    Answered By: Chad Bradley     Answered On: Jan 31

This should do the trick I think...


Private Sub cboLimitToList_Change()

Dim slText As String
Dim ilN As Integer
Dim ilLen As Integer

If cboLimitToList.Text = "" Then
Exit Sub
End If

slText = cboLimitToList.Text
ilLen = Len(slText)

For ilN = 0 To cboLimitToList.ListCount - 1
If slText = Mid(cboLimitToList.List(ilN), 1, ilLen) Then
Exit Sub
End If
Next

cboLimitToList.Text = ""

End Sub

 
Answer #16    Answered By: Laurel Collins     Answered On: Jan 31

I appreciate all the suggestions and help the various users have
offered but I seem to conclude that it may not be possible for a combo
box to function like a calendar control (i.e. quite simply, for the
user to click on the down arrow and select  from the list). I am aware
this can be done quite easily in ACCESS by using the LimitToList
property of the combo box). If any one has a simple solution that
works exactly like the combo box in ACCESS, it would be welcomed.

 
Answer #17    Answered By: Orville Rodriguez     Answered On: Jan 31

In 2003 it's View / Toolbox in the VBE to get the toolbox.

 
Didn't find what you were looking for? Find more on Drop down lists Or get search suggestion and latest updates.




Tagged: