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!

How to display the second column of a combo box on a report

Status
Not open for further replies.

jmeadows7

IS-IT--Management
Jun 13, 2001
148
0
0
US
I have a report that is called from a form to specify parameters for the underlying query. On the report, I want to show the from and to dates which is pretty easy - just reference the value from the form.

I reference the site id parameter that is chosen from a combo box:
=[Forms]![crw010_MP2_Reporting]![cborw010_Site]
and it displays the actual site id - ie 2693. I really want to reference the row selected and the item displayed on the window. Can I do that from within the report. I've tried several variations but haven't had any luck. This should be pretty easy, and I thought I had done it with Access95 about 13 to 15 years ago, but I can't remember how.

Thanks in advance!
 

To reference any column from a combo box other than the bound column use
Code:
[combobox].[column](x)
So your report textbox control source according to your example should be
Code:
=Forms![crw010_MP2_Reporting]![cborw010_Site].[Column](x)
where x is the number of the desired column (0 based index, so if it is the second column its number is really 1)

Clear as mud?
 
Thanks - can't believe I had forgotten that - just don't do as much development as I use to. Thanks again for the reminder.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top