Results 1 to 7 of 7
  1. #1
    Join Date
    Nov 2002
    Location
    Hamilton,Ontario
    Posts
    132

    Exclamation Unanswered: How to force user to only choose the value from ComboBox

    Hi All:

    I have one issues that i would like to get ur insight about. I have a combo box that is used to derive the ItemID . I would like to restrict the user to only choose the value from combobox rather than typing in any text. The reason why I want to do that is when i gave the application out for testing , they kept entering invalid text instead of choosing from the combobox and that caused great deal of inproper behaviour in the application . Any insight would be appreciated. Thank you in advance.

  2. #2
    Join Date
    Dec 2003
    Location
    Dallas, TX
    Posts
    1,004

    Talking

    HI there,

    Easy one. Just go to your form in DesignView, open the ComboBox properties window and click on the DataTab. Go do till you see LimitToList, there you simply select YES. That's it and have a nice one.

    Bud

  3. #3
    Join Date
    Nov 2002
    Location
    Hamilton,Ontario
    Posts
    132
    Thank you So much. It is really working like a magic

  4. #4
    Join Date
    Dec 2003
    Location
    Dallas, TX
    Posts
    1,004

    Talking

    Quote Originally Posted by VBAPROGRAMMER
    Thank you So much. It is really working like a magic

    Anytime and have a nice weekend,,, I'm outta here!!!!!!!!!!!!!1

    Bud

  5. #5
    Join Date
    Nov 2003
    Posts
    1,487
    Here's another way...

    Code:
    Private Sub myComboBox_KeyDown(KeyCode As Integer, Shift As Integer)
    	MsgBox "Forget that idea my freind...Select from the list."
    	KeyCode = 0
    End Sub
    or you can just forget about the message and put KeyCode = 0 into the ComboBox KeyDown Event. They can then hit all the keys they want but it just wont do anything (elliminates the Not In List message).



  6. #6
    Join Date
    Jun 2002
    Location
    Saudi Arabia / Philippines
    Posts
    126
    CyberLynx,

    Did you mean "friend" or "fiend"? Both seem appropriate!
    Rod

    fe_rod@hotmail.com

  7. #7
    Join Date
    Nov 2003
    Posts
    1,487
    D O H



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •