Solved

ComboBoxes with dropdownlist style

Posted on 1998-08-30
4
373 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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

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

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 Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

726 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