Access: Date in an unbound field on a form

gheyman

Well-known Member
Joined
Nov 14, 2005
Messages
1,837
Office Version
  1. 365
Platform
  1. Windows
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

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
56,738
Office Version
  1. 365
Platform
  1. 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,128,089
Messages
5,628,609
Members
416,327
Latest member
Chimay

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top