Access: Date in an unbound field on a form

gheyman

Well-known Member
Joined
Nov 14, 2005
Messages
1,690
I want to add a field on my form that will act as a "Title". Actually I have 6 fields. In the first one, if todays date is in the month of September I want it to say "September" in the field. I would even be OK with the Month and Year (But not the day). In the next box if today is 9/17/2019 I want this second field to say "August" (again August 2019) would be acceptable. And so on for each of the six
September (or September 2019)
August
July
June
May
April

I am showing data in unbound fields for the last six months, which is why I need these "header". Again this is on a form, not a table or query...

Thanks for the help
 

Some videos you may like

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
52,118
Office Version
365
Platform
Windows
Enter this into the Control Source of the first Text Box:
Code:
=Format(Date(),"mmmm")
which will return current month (September).

Enter this into the Control Source of the first Text Box:
Code:
=Format(DateAdd("m",-[COLOR=#0000ff]1[/COLOR],Date()),"mmmm")
which will return prior month (August).

Then, just change the number in blue to 2, 3, 4, and 5 for the other four months, respectively.
 

Forum statistics

Threads
1,089,667
Messages
5,409,626
Members
403,272
Latest member
Karl Matacz

This Week's Hot Topics

Top