teh jimpie Posted June 4, 2010 Author Share Posted June 4, 2010 > If Not cmbType1.Text Or cmbType2.Text = cmbType1.List Or cmbType2.List Then> Call MsgBox("Please enter a valid type!")> Exit Sub> End If"Compile error:argument not optional"whats wrong? Link to comment Share on other sites More sharing options...
balliztik1 Posted June 4, 2010 Share Posted June 4, 2010 .List needs a number. Because it's a list, you need to specify an index, like so:```If something = cmdType1.List(0) Then```Also, you've got some odd syntax there. Are you comparing a list to itself? Link to comment Share on other sites More sharing options...
teh jimpie Posted June 5, 2010 Author Share Posted June 5, 2010 I want to make it so that you can't use anything else then something what is in the list, because when you press backspace you can type your own text. But now I have runtime-error 13, "mismatch" Link to comment Share on other sites More sharing options...
balliztik1 Posted June 5, 2010 Share Posted June 5, 2010 Set the Combo box's Style property to "2 - Dropdown List". That will prevent text entry. Link to comment Share on other sites More sharing options...
teh jimpie Posted June 5, 2010 Author Share Posted June 5, 2010 thanks :) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now