Solved

ComboBoxes with dropdownlist style

Posted on 1998-08-30
4
370 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

861 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now