Displaying last months name (1 Viewer)

Esjaye

Registered User.
Local time
Today, 10:40
Joined
Aug 1, 2018
Messages
22
ok, you were all amazing helping last time so hopefully it will happen again.

I have a report that shows all of the orders that happened last month.

I want a label/text box/something to say orders for _____ and the month to automatically appear .... how do i do it please?

huge amount of thanks xx
 

June7

AWF VIP
Local time
Today, 02:40
Joined
Mar 9, 2014
Messages
5,423
How do you open report filtered for last month records?
 

Galaxiom

Super Moderator
Staff member
Local time
Today, 21:40
Joined
Jan 20, 2009
Messages
12,849
There are many ways to do it.
In the ControlSource of a textbox:
Code:
= "Orders for " & MonthName(Month(Date()) MOD 12 + 11)
This one is based on simple arithmetic compared to manipulating dates or using Format.
 

Esjaye

Registered User.
Local time
Today, 10:40
Joined
Aug 1, 2018
Messages
22
thank you galaxiom - love you guys xx

and june - i based the report on query that had Between DateSerial(Year(Date()),Month(Date())-1,1) And DateSerial(Year(Date()),Month(Date()),0)

on the criteria .... not sure if its the best way to do it but hey it works
 

Esjaye

Registered User.
Local time
Today, 10:40
Joined
Aug 1, 2018
Messages
22
There are many ways to do it.
In the ControlSource of a textbox:
Code:
= "Orders for " & MonthName(Month(Date()) MOD 12 + 11)
This one is based on simple arithmetic compared to manipulating dates or using Format.

im clearly doing something wrong because i get #Func! when i do this. HELP .... sorry for being thick
 

Galaxiom

Super Moderator
Staff member
Local time
Today, 21:40
Joined
Jan 20, 2009
Messages
12,849
im clearly doing something wrong because i get #Func! when i do this. HELP .... sorry for being thick

No it's my mistake. Something went wrong between what I had working and what I posted. Just can't see what just now.
 

Esjaye

Registered User.
Local time
Today, 10:40
Joined
Aug 1, 2018
Messages
22
who knew trying to put a damn title on report was so bloody complicated!

Please let me know when you work it out. Thank you so much
 

Galaxiom

Super Moderator
Staff member
Local time
Today, 21:40
Joined
Jan 20, 2009
Messages
12,849
Back to basics:
Code:
MonthName(Month(DateAdd("m", -1, Date())))

My mistake earlier was because I tested for January and December, thinking that would cover it, but it didn't.
 

Esjaye

Registered User.
Local time
Today, 10:40
Joined
Aug 1, 2018
Messages
22
woohoo it works thank you so so much xx
 

Users who are viewing this thread

Top Bottom