Access: Date in an unbound field on a form

gheyman

Well-known Member
Joined
Nov 14, 2005
Messages
1,691
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

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
52,161
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.
 

Watch MrExcel Video

Forum statistics

Threads
1,090,109
Messages
5,412,464
Members
403,428
Latest member
ldmcd

This Week's Hot Topics

Top