Date syntax to show current year and day

  • Thread starter Thread starter Dave Elliott
  • Start date Start date
D

Dave Elliott

I have this code for an unbond control on my form, I need it instead to show
the current year and beginning day of year. January 1, 2005 or whatever is
current.
Me.StartDate = DateAdd("yyyy", -1, Date) + 1
 
Dave Elliott said:
I have this code for an unbond control on my form, I need it instead
to show the current year and beginning day of year. January 1, 2005
or whatever is current.
Me.StartDate = DateAdd("yyyy", -1, Date) + 1

I'm not sure if this is what you're after, but it will always give you
January 1st of the current year:

Me.StartDate = DateSerial(Year(Date), 1, 1)
 
I have this code for an unbond control on my form, I need it instead to show
the current year and beginning day of year. January 1, 2005 or whatever is
current.
Me.StartDate = DateAdd("yyyy", -1, Date) + 1

Try DateSerial(Year(Date()), 1, 1)

John W. Vinson[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

Back
Top