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

Concatenated Field Containing all field values inc Combo

Status
Not open for further replies.

hansdebadde

Technical User
Jan 20, 2005
214
0
0
CA
I have a subform where the last field is a concatenated combination of all the fields so the user can copy all of it to paste it into another db (only possible solution). I am using Access 2010, the data is on a SQL 2008 back end. I have been able to concatenate the fields except the combos.
The row source for one of the combos is:
SELECT ICC_tbl_Lookups.LookupID, ICC_tbl_Lookups.str_Item FROM ICC_tbl_Lookups
The name of the combo is CB_or_CA_Method_Combo and its control source is CB_or_CA_Method_ID
Any ideas how to pull the value selected in the combo?
 
With combos you need to reference the Index of the column otherwise the bound column is the value. Use 0 for the first column 1,2 an so on

eg. Combo1.Column(0)

The bound column is the value selected you can refer to it in the same form in code as Me.Combo1.Value

or by form by reference Forms![Form1]![Combo1]





HTH << MaZeWorX >> "I have not failed I have only found ten thousand ways that don't work" <<Edison>>
 
Thanks MazeWorX
So in my case I would put Forms![MyForm]![CB_or_CA_Method_Combo]
Do i need a (0) here so the calculated field can pull the right value from the combo (like "phone","email") not the IDs (like 1-4)?
 
It will return the bound column value. look at the properties and you will see which column it is bound 2. if all of the columns aren't visible you can refer to the query the column order matches the combo.


Combo1.Column(0) would return the value of the first column Combo1.Column(1) the second column. Assuming the data is in the bound column you would reference it as you have in your post. Only if it resides outside of the bound column use the later method

HTH << MaZeWorX >> "I have not failed I have only found ten thousand ways that don't work" <<Edison>>
 
Thanks again MaZeWorX, our network just went down and so i will check it later. Makes sense to me.
 
lol hope it wasn't you that crashed it hehe

HTH << MaZeWorX >> "I have not failed I have only found ten thousand ways that don't work" <<Edison>>
 
It worked! Thanks! You rock! I had to use this format
=[CB_or_CA_Method_Combo].[Column](1)
 
cool [rockband]

HTH << MaZeWorX >> "I have not failed I have only found ten thousand ways that don't work" <<Edison>>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top