Error trapping ComboBox input

  • Thread starter Thread starter Snowfire
  • Start date Start date
S

Snowfire

This is driving me mad... I want a combobox to react in this way...
The combo will dropdown and provide a selection of three options "E"
"L" or "N"
If the user types in say... "E" it accepts this and moves on. If he
types say "R" it will complain and not move-on.
I can get the combo to select "E" from the dropdown and it works. But
type "E" (an exact match) and it complains.
I have gone through all the settings suggested in this newsgroup but
can't get this simple error trap and acceptance sequence...... I must
be missing the obvious can any one please help.
 
I created a small userform with a couple of comboboxes and tried this:

Option Explicit
Private Sub UserForm_Initialize()
With Me.ComboBox1
.Style = fmStyleDropDownList
.MatchEntry = fmMatchEntryComplete
.AddItem "E"
.AddItem "L"
.AddItem "N"
End With
End Sub


I couldn't duplicate your results.
 
what do you mean by "accepts and moves on" ? are you running some code ? is
this a userform combo or is it on a sheet ?
 
Dave, Patrick, thanks for your replies. I was trying to load the
selections via the DropButtonClick event and this was causing me all
sorts of problems. Once I put them in the UserForm_Initialize the
selections (thanks for the code) behaved as expected?
Not related to this problem but I was unable to get my posting from
my home computer? Had to wait til I got back to work....No matter how
I "googed" the search"?? (hence the delay in replying).... but found
older requests I had placed for help.
 
Back
Top