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

Interesting thing I noticed about Combobox.Value

Status
Not open for further replies.

ESquared

Programmer
Dec 23, 2003
6,129
US
When I use the name of my combo box to get its default property, Value, a string is returned. I assume it would be the same for combobox.Value, but I admit I haven't tried it.

For example, cboYear evaluates to "2004."

But when I use cboYear.ItemData(cboYear.ListIndex) I get a value, 2004.

I ran into a sneaky bug for a while until I discovered this.

Can anyone explain this and/or give me some hints as to why this is happening? It's most unpleasant!
 
This may be an issue of datatype precedence order though I have not seen it documented anywhere. You can check with VB 6 documentation for ItemData and see if anything is given there

Living with Microsoft :-(

cboYear.Column(cboYear.boundcolumn-1,cboYear.ListIndex) Must return you the same value but as String


Best of luck
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top