Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

ComboBoxes with dropdownlist style

Posted on 1998-08-30
4
Medium Priority
?
377 Views
Last Modified: 2010-04-30
When fillng list property at runtime with dropdownlist style
it gives me the message "Property is read-only".If I set the style property after filling the list property then it displays "cannot assign to a read-only property" message.
Is there any way to use the comboboxes with the dropdownlist style by filling the list property at runtime.

Thanks in advance
0
Comment
Question by:guvencum
  • 2
  • 2
4 Comments
 

Accepted Solution

by:
vinoopauls earned 40 total points
ID: 1431892
There is only one way i know of:
Fill the combo box
Then iterate thru the items till you get the item you want
Then assign the listindex
This will set the list property for the read only type combo box
For the other style you can directly type
0
 

Author Comment

by:guvencum
ID: 1431893
send me a piece of code please
then I understand what you mean and appreciate you

0
 

Author Comment

by:guvencum
ID: 1431894
send me a piece of code please
then I understand what you mean and appreciate you

0
 

Expert Comment

by:vinoopauls
ID: 1431895
Here the combo box style property is set to 2 ie read only

cmb1.AddItem "one"
cmb1.AddItem "two"
cmb1.AddItem "three"
cmb1.AddItem "four"

    For n = 0 To cmb1.ListCount - 1
        If cmb1.List(n) = "three" Then Exit For
    Next n
    If n < cmb1.ListCount Then
        cmb1.ListIndex = n
    Else
        cmb1.ListIndex = -1
    End If

If there is a simpler way i would be really grateful!!
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question