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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Assiging a value to a 2 columns combo

Status
Not open for further replies.

pedrosfaria

Technical User
Aug 28, 2007
2
PT
This should be straightforward but it keeps me giving me an error.
I have a ComboBox in a sheet named "Folha1", como named cbboLocalidade.
I want to initialize that combo with a value. That combo is a two column combo but that should be no problem.
I assign values to other combo's (but just of 1 column) and work's fine. When I try to assign to Combo cbboLocalidade -it gives me "time error 380" over and over again.

The code I use is

Sub Workbook_Open()

Folha2.Activate
Folha1.Activate
Folha1.cbboAnimais = "Suínos"
Folha1.cbboPaises = "Argentina"
Folha1.cbboRegiao = "Buenos Aires"
Folha1.cbboLocalidade = 2

End Sub


The bound colum is numeric. i've allready tried
Folha1.cbboLocalidade = "2"

and

Folha1.cbboLocalidade.Value = 2

but gives me the same error.

Can someone help me? Do you know another wat of setting a default value for a combo in initialization?

Thx

Pedro
 
The only way I could seem to get this error to occur is if I set the property of textcolumn to 0.
Check this property of the comobox and see if you change it to a 1 what do you get.

ck1999
 
Thx ck1999. But somehow I'm not able to make it work. keeps giving the same error. maybe there is some problem in the code somewhere else.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top