1
votes

How can I get the value of an unbound column of a combo box using the expression builder in Access 2007?

I have a form that controls a query through a combo box where I select a month on the form and Access runs a query for items pertaining to that month. Then I have a report that based on that query.

I'd like the report header to display the month that was selected. I made a text box in the report that uses an expression as the control source like so "=[Forms]![frm Annual Notices Report]![Combo10]". Which works expect it returns the value in Col1. How can I make my text box display the month in Col2? I've tried "=[Forms]![frmMyform]![Combo10(1)]", but it returns an error.

My combo box is setup like this:

Col1       Col2
1          January
2          February
3          March
4          April
...        ...

I need to use the month index to control the query, but I also want to make a text box in a report show the month as written.

TL;DR: How can I make a text box display the month in Col2?

Currently I have this: "=[Forms]![frmMyForm]![Combo10]"

I think I need something like this: "=[Forms]![frmMyform]![Combo10(1)]"

1

1 Answers

2
votes

You need the .Column property.

=[Forms]![frmMyForm]![Combo10].Column(1)

is the second column.

BTW, there is also the MonthName() function.