Noneditable combobox

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Abhishek Bhatt
    New Member
    • Sep 2007
    • 36

    Noneditable combobox

    I have implemented a combobox. I have defined 3 values in the value list and have set limit ot list property to Yes. I want user to select any one value from these 3 only. Problem is that user is still able to edit the combo field. After that when the focus gets out of it, a message comes saying "The text you entered isn't an item in the list. Select an item from the list or enter text that matches one of the listed items."

    Is there a way that user is not allwed to edit this field?

    I am using MSAccess with VB vesrion 6.3
  • hariharanmca
    Top Contributor
    • Dec 2006
    • 1977

    #2
    Use Combo Box Style in Form load event

    [CODE=vb]cmbName.Style = 2 'Dropdown list[/CODE]

    Comment

    • QVeen72
      Recognized Expert Top Contributor
      • Oct 2006
      • 1445

      #3
      Originally posted by hariharanmca
      Use Combo Box Style in Form load event

      [CODE=vb]cmbName.Style = 2 'Dropdown list[/CODE]
      Hi,

      Style of Combobox is a Design Time property, u cannot use @ Runtime in codes, so set in Property sheet of combobox at design time

      Regards
      Veena

      Comment

      • hariharanmca
        Top Contributor
        • Dec 2006
        • 1977

        #4
        Okay, i aggree. It cannot be set at desigen time.

        Comment

        • Abhishek Bhatt
          New Member
          • Sep 2007
          • 36

          #5
          I am not able to find "style" property when I open the property popup of the combobox by right clicking on it. Am I missing something?
          Last edited by Abhishek Bhatt; Oct 1 '07, 09:47 AM. Reason: spelling

          Comment

          • QVeen72
            Recognized Expert Top Contributor
            • Oct 2006
            • 1445

            #6
            Hi,

            ComboBox shud have "Style" property..
            VB6 or VB.net..?

            Regards
            Veena

            Comment

            • Abhishek Bhatt
              New Member
              • Sep 2007
              • 36

              #7
              It's VB6.3 (comes with MSAccess)

              Comment

              Working...