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
 

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
51,771
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,085,203
Messages
5,382,319
Members
401,782
Latest member
alisoncleverly

Some videos you may like

This Week's Hot Topics

Top