I'm trying to display the next month in a text field

  • Thread starter Thread starter gmazza
  • Start date Start date
G

gmazza

Hi there,
I've gone through all the forms and can't seem to get the code straight for
displaying the next month on a text field on my form.
I just want the entire month name and nothing else and I have been struggling
with:
DateSerial(Year(Date()), Month(Date()) + 1, 1)

but its showing the day and year too and thats not what I need.
Thanks in advance!
GM
 
You need to look at te Format() function.

Format(YourExpression,"mmm")

That will display your date expression as a full month name.

Steve
 
gmazza said:
Hi there,
I've gone through all the forms and can't seem to get the code straight for
displaying the next month on a text field on my form.
I just want the entire month name and nothing else and I have been struggling
with:
DateSerial(Year(Date()), Month(Date()) + 1, 1)

but its showing the day and year too and thats not what I need.


MonthName(Month(Date()) + 1)
 
Hi there,
I've gone through all the forms and can't seem to get the code straight for
displaying the next month on a text field on my form.
I just want the entire month name and nothing else and I have been struggling
with:
DateSerial(Year(Date()), Month(Date()) + 1, 1)

but its showing the day and year too and thats not what I need.
Thanks in advance!
GM

One quick & dirty way is to use this expression and set the Format property of
the textbox to

"mmmm"

John W. Vinson [MVP]
 
Thanks Steve, that does work, but when I add 1 to it, I get an error.
I just want The current month + 1 to always show up.
You need to look at te Format() function.

Format(YourExpression,"mmm")

That will display your date expression as a full month name.

Steve
Hi there,
I've gone through all the forms and can't seem to get the code straight for
[quoted text clipped - 6 lines]
Thanks in advance!
GM
 
Thanks Marshall, but its not a specific month I need, I need 1 added to the
current month. Is there a way I can do that with your expression?

Marshall said:
Hi there,
I've gone through all the forms and can't seem to get the code straight for
[quoted text clipped - 4 lines]
but its showing the day and year too and thats not what I need.

MonthName(Month(Date()) + 1)
 
Good call John, that worked, and you're right, it is a little dirty way to do
it but I'll take it!
Thanks for your help everyone!!
GM
Hi there,
I've gone through all the forms and can't seem to get the code straight for
[quoted text clipped - 6 lines]
Thanks in advance!
GM

One quick & dirty way is to use this expression and set the Format property of
the textbox to

"mmmm"

John W. Vinson [MVP]
 
One of us is confused ;-)

As far as I can tell, my expression and John's suggestion
are just two different ways of getting the same result.
--
Marsh
MVP [MS Access]

Thanks Marshall, but its not a specific month I need, I need 1 added to the
current month. Is there a way I can do that with your expression?

Marshall said:
Hi there,
I've gone through all the forms and can't seem to get the code straight for
[quoted text clipped - 4 lines]
but its showing the day and year too and thats not what I need.

MonthName(Month(Date()) + 1)
 
As far as I can tell, my expression and John's suggestion
are just two different ways of getting the same result.

and yours is cleaner... must have been something lost in transition there!

John W. Vinson [MVP]
 
Back
Top