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

Combobox Returns Row Values rather than text

Status
Not open for further replies.

lisamac92

Programmer
Jun 16, 2005
1
GB
Please help (I have been stuck on this for 4 days now!!!)

I have created a form (frmLibrary) with a number of comboboxes which works fine. However, I have now created a subform, where I want another combox based on frmLibrary. However, I get the row number returned rather than the text contained within it.

Thanks for your help.
 
You need to use column notation:

Me!txtMyField = Me!cboMyCombo.Column(x)

Where x is an integer that represents the column in the combo that holds the data you want. Remember, combo columns are zero-based, so the first column is Column(0), the second column is Column(1), etc.

Ken S.
 
If the column is based on a table or anything that has more than 1 value you will need to hide the first column or the column that you do not want to see.
You can do this by viewing the combo box properties and setting the column count to 2 and then setting the column width property to 0";3" or whatever width you want for the column you wish to view. This is assuming that the value you want to view is actually the second column. If it is the fourth column then you would need something like column count 4 and column width 0";0";0";3"
Hope this helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top