First date and last date of the current month

I

Irshad Alam

Please advice code, which I want to use on click event of a button of a FormSPL

Me.Text13 = First date of the current month
Me.Text16 = Last date of the current month

Thanks and best regards

Irshad
 
T

Tom van Stiphout

First Date: Check out the DateSerial function in the help file, Combined with
Year(Date) and Month(Date) it should do the trick.
Last Date: From the First Date, go forward 1 month, then go back 1 day. Use
the DateAdd function for this.

-Tom van Stiphout
Microsoft Access MVP
 
D

Douglas J. Steele

Just to be a little more explicit than Tom <g>

First day of the current month:
DateSerial(Year(Date), Month(Date), 1)

Last day of the current month:
DateSerial(Year(Date), Month(Date) + 1, 0)
 
T

Tom van Stiphout

On Sun, 18 Apr 2010 06:58:27 -0400, "Douglas J. Steele"

You gave him a fish!

-Tom.
Microsoft Access MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top