G
Gordon
I'm trying to define a function for the last quarter that when
selected will allow me to populate "Start from" and "To" text boxes.
I can make the To bit work but not the From. The code I currently
have is:
Me!txtDateFrom = DateAdd("q", -1, DateSerial(Year(Now()),
DatePart("q", Now()), 1))
As of the date of posting (20 March 2010), this correctly produces 01
October 2009, but if I go back in time by resetting my computer date,
it produces a date of 01 January 2009 (instead of 01 July 2009).
My formula is clearly wrong somewhere but despite many permutations I
just can't get it to work.
Can anyone help me please?
Gordon
selected will allow me to populate "Start from" and "To" text boxes.
I can make the To bit work but not the From. The code I currently
have is:
Me!txtDateFrom = DateAdd("q", -1, DateSerial(Year(Now()),
DatePart("q", Now()), 1))
As of the date of posting (20 March 2010), this correctly produces 01
October 2009, but if I go back in time by resetting my computer date,
it produces a date of 01 January 2009 (instead of 01 July 2009).
My formula is clearly wrong somewhere but despite many permutations I
just can't get it to work.
Can anyone help me please?
Gordon