Link to home
Start Free TrialLog in
Avatar of printmedia
printmedia

asked on

Combo Box in Access 2003

Hi all.

I have a combo box in an Access 2003 form that lists: 1, 2, 3...12 (it represents each month of the year). When the end user selects a number, say 3 it will show the sales for March.

I want to be able to show in the Report title via a text box the month name (i.e. MARCH) instead of the number (3). How can I do this besides using IIF statements, is there a way to do this in the combo box?

Thank you in advance!
Avatar of rj8820
rj8820

Easy: in the report open event write some vba code that defines an array of strings say called months and load them with the months.

dim months(12) as string
months(1)="January"
Months(2)="February".. etc

 Then just insert months(variable) into you report title
Avatar of Randy Downs
Just click on properties of the combo box and change the names from 3 to 3 - March or whatever you like.
ASKER CERTIFIED SOLUTION
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Assuming the combobox is two columns, column1 is the number and column2 is the month name, use combo0.column(1)
Avatar of printmedia

ASKER

I used a text box in the form to store the month name and referenced that in the report using your code.

Thanks!