Solved

ComboBoxes with dropdownlist style

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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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…

762 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

17 Experts available now in Live!

Get 1:1 Help Now