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

Referencing the Unbound column of a combo box

Status
Not open for further replies.

strangeryet

Programmer
Jul 8, 2004
159
US
I have a combo box where the bound column is the numeric Id of the text being displayed on the form (ie. the text equivalent). So the field may read "Operations" and the numeric bound field to the database would be a "3" (for Operations).

In the code when I select the combo box ie..me.cmb122.value or me.cmb122 I always get back the "3". What do I use in order to see the text equilalent?

In other words, what property of the combox will show me "Operations"?

Thanks
 
Try:

me.cmb122.column(columnnumber)

Change column number to the column number you want, and remember it is 0 based....so the first column = is 0, the second coumn is 1 and so on

=======================================
People think it must be fun to be a super genius, but they don't realize how hard it is to put up with all the idiots in the world. (Calvin from Calvin And Hobbs)

Robert L. Johnson III
CCNA, CCDA, MCSA, CNA, Net+, A+, CHDP
VB/Access Programmer
 
Thanks, I did try that, and I tried it again but the result was Null. Yet I can see the value "Operations" in the combo box. Any ideas?
 
Can you post your source for the combobox?

=======================================
People think it must be fun to be a super genius, but they don't realize how hard it is to put up with all the idiots in the world. (Calvin from Calvin And Hobbs)

Robert L. Johnson III
CCNA, CCDA, MCSA, CNA, Net+, A+, CHDP
VB/Access Programmer
 
Here is a piece of the line which I am building a string from.

"Assigned to: " & Me.Combo122.Value & "-" & Me.Combo122.Column(2) & vbCrLf & _

Combo122.value = "3"...Combo122.column(2) = Null

Where I need it to look like...Assigned To: 3 - Operations

Thanks


 
I know what the problem is...the column count must be indexed as 0 & 1 not 1 & 2. When I use (1) as the index I can now see the text value.
Thanks for your help and pointing me in the right direction.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top