If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Month in title of monthly report
I am new to Access and have been trying to get the month name show up in the
title of a report. I am using a form for the input of the [Month] and [Year] as numbers. Then use the form control button to execute a report. This works great. I then would like to use the input from the form [Month] to put the name of the month in the title of the report. I put in a text box and can get it to display the number of the month (ex. 5) but not the name of the month name (Ex. May). I do not know how to format it to mmmm. I tried an array: Dim rmonth rmonth = Array(“January”, “February”, “March”, “April”, “May”, “June”, “July”, “August”, “September”, “October”, “November”, “December”) rmonth() I tried to put that in the control source and it did not work. Please help. Thanks, Charkey |
#2
|
|||
|
|||
Month in title of monthly report
If the form is named Form1, and the month combo is named cboMonth, put an
expression like this into the Control Source of the text box on your report: =MonthName([Forms]![Form1]![cboMonth]) That should work provided the combo's bound column contains a number between 1 and 12. Use IIf() to avoid the error if it is null. -- Allen Browne - Microsoft MVP. Perth, Western Australia Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "charkey" wrote in message ... I am new to Access and have been trying to get the month name show up in the title of a report. I am using a form for the input of the [Month] and [Year] as numbers. Then use the form control button to execute a report. This works great. I then would like to use the input from the form [Month] to put the name of the month in the title of the report. I put in a text box and can get it to display the number of the month (ex. 5) but not the name of the month name (Ex. May). I do not know how to format it to mmmm. I tried an array: Dim rmonth rmonth = Array(“January”, “February”, “March”, “April”, “May”, “June”, “July”, “August”, “September”, “October”, “November”, “December”) rmonth() I tried to put that in the control source and it did not work. Please help. Thanks, Charkey |
#3
|
|||
|
|||
Month in title of monthly report
It's easy - Look up MonthName function in Access Help system.
-- Dorian "Give someone a fish and they eat for a day; teach someone to fish and they eat for a lifetime". "charkey" wrote: I am new to Access and have been trying to get the month name show up in the title of a report. I am using a form for the input of the [Month] and [Year] as numbers. Then use the form control button to execute a report. This works great. I then would like to use the input from the form [Month] to put the name of the month in the title of the report. I put in a text box and can get it to display the number of the month (ex. 5) but not the name of the month name (Ex. May). I do not know how to format it to mmmm. I tried an array: Dim rmonth rmonth = Array(“January”, “February”, “March”, “April”, “May”, “June”, “July”, “August”, “September”, “October”, “November”, “December”) rmonth() I tried to put that in the control source and it did not work. Please help. Thanks, Charkey |
#4
|
|||
|
|||
Month in title of monthly report
Thanks for the help! I did a search with the help, online using google and
never found that function. It works great! Thanks, Charkey "Allen Browne" wrote: If the form is named Form1, and the month combo is named cboMonth, put an expression like this into the Control Source of the text box on your report: =MonthName([Forms]![Form1]![cboMonth]) That should work provided the combo's bound column contains a number between 1 and 12. Use IIf() to avoid the error if it is null. -- Allen Browne - Microsoft MVP. Perth, Western Australia Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "charkey" wrote in message ... I am new to Access and have been trying to get the month name show up in the title of a report. I am using a form for the input of the [Month] and [Year] as numbers. Then use the form control button to execute a report. This works great. I then would like to use the input from the form [Month] to put the name of the month in the title of the report. I put in a text box and can get it to display the number of the month (ex. 5) but not the name of the month name (Ex. May). I do not know how to format it to mmmm. I tried an array: Dim rmonth rmonth = Array(“January”, “February”, “March”, “April”, “May”, “June”, “July”, “August”, “September”, “October”, “November”, “December”) rmonth() I tried to put that in the control source and it did not work. Please help. Thanks, Charkey . |
#5
|
|||
|
|||
Month in title of monthly report
"charkey" wrote in message ... I am new to Access and have been trying to get the month name show up in the title of a report. I am using a form for the input of the [Month] and [Year] as numbers. Then use the form control button to execute a report. This works great. I then would like to use the input from the form [Month] to put the name of the month in the title of the report. I put in a text box and can get it to display the number of the month (ex. 5) but not the name of the month name (Ex. May). I do not know how to format it to mmmm. I tried an array: Since the question's been answered for your specific case, here's an answer for the more general case when you only have the date rather than the month number: This will give you the full month name for date. format(date,"mmmm") and this will give you the three-letter abbreviation: format(date,"mmm") Tom Lake |
Thread Tools | |
Display Modes | |
|
|