Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dumb Combo Box Question...

Status
Not open for further replies.

PogoWolf

Programmer
Mar 2, 2001
351
US
How can I add an item to a Combo Box from code?
I thought 'AddItem' would do the trick.. but my app is coming back saying that it's read-only...
---===///The PogoWolf\\\===---
Darkness..Bleakness..Plastic forks..?

 
What are you using as RowSource for the combo?
Grigore Dolghin
Class Software
Bucharest, Romania
 
If myCombo.RowSourceType = 0 then only you can use
myCombo.additem(cItem)
Hope this helps
ramani :-9
(Subramanian.G)
FoxAcc
ramani_g@yahoo.com
LET KNOW IF THIS HELPED. ENOUGH EXPERTS ARE HERE TO HELP YOU OUT! BEST OF LUCK :)
 
As Ramani pointed out, if your RowSourceType is 0, you can use AddItem. Otherwise, you must add the items to the SOURCE, not to the combo box. For example, if you have RowSourceType of 6, you must add the items to the table(s) involved. If you have Type of 1, you must completely update the RowSource string that contains the values (something like Combo1.RowSource=Combo1.RowSource+"NewItem")
 
Thanks for the messages.. I had my Syntax incorrect for additem.

I was thinking in VB (addItem "blah") I replaced it with
Additem("blah") and that fixed it!

thank you for the help!!! =)
---===///The PogoWolf\\\===---
Darkness..Bleakness..Plastic forks..?

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top