[Webinar] Streamline your web hosting managementRegister Today


Combo Box in Access 2003

Posted on 2011-04-20
Medium Priority
Last Modified: 2012-05-11
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!
Question by:printmedia

Expert Comment

ID: 35433913
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(2)="February".. etc

 Then just insert months(variable) into you report title
LVL 30

Expert Comment

by:Randy Downs
ID: 35433915
Just click on properties of the combo box and change the names from 3 to 3 - March or whatever you like.
LVL 120

Accepted Solution

Rey Obrero (Capricorn1) earned 2000 total points
ID: 35434093
place this codes in the Change or afterupdate event of the combo box

private sub combo0_afterupdate()
dim MonthName as string

msgbox MonthName

end sub

you can use the string MonthName in your report

Expert Comment

ID: 35434469
Assuming the combobox is two columns, column1 is the number and column2 is the month name, use combo0.column(1)

Author Closing Comment

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


Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Windows Explorer let you handle zip folders nearly as any other folder: Copy, move, change, and delete, etc. In VBA you can also handle normal files and folders, but zip folders takes a little more - and that you'll find here.
Beware when using the ListIndex and the Column() properties of a listbox in Access 2007.  A bug has been identified in the Access 2007 listbox code which can cause the .ListIndex property to return a -1, and the .Columns(#) property to return a NULL…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

612 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question