A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Month in title of monthly report



 
 
Thread Tools Display Modes
  #1  
Old April 8th, 2010, 02:48 PM posted to microsoft.public.access.reports
charkey
external usenet poster
 
Posts: 6
Default 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  
Old April 8th, 2010, 03:43 PM posted to microsoft.public.access.reports
Allen Browne
external usenet poster
 
Posts: 11,706
Default 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  
Old April 8th, 2010, 03:53 PM posted to microsoft.public.access.reports
Dorian
external usenet poster
 
Posts: 542
Default 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  
Old April 8th, 2010, 06:37 PM posted to microsoft.public.access.reports
charkey
external usenet poster
 
Posts: 6
Default 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  
Old April 8th, 2010, 07:25 PM posted to microsoft.public.access.reports
Tom Lake[_2_]
external usenet poster
 
Posts: 96
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:27 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright 2004-2024 OfficeFrustration.
The comments are property of their posters.