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 derfloh 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
Joined
Jun 13, 2001
Messages
148
Location
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?
 
Can't you simply join the table from the combobox's Row Source into your report's record source. This will allow you to bind the appropriated column.

Duane
Hook'D on Access
MS Access MVP
 
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