Setting calendar control to value of specific date of current year

  • Thread starter Thread starter rgrantz
  • Start date Start date
R

rgrantz

I don't know how VBA or the calendar control parses/reads date info, but I'm
trying to set the calendar control value (which apparently needs to be done
in the FormOnLoad event) to January 1st of the current year. I can get
Date()-365 and all that to work, but I have no idea how to set a specific
date:

I tried

me.Calendar.value = 1/1 & Year(Date)

and

me.calendar.value = "1/1" & Year(Date)

And several other variations.

Anyone know the syntax to use for something like this?

Thanks everyone
 
Hi,
Use DateSerial like this:

Me.Calendar3.Value = DateSerial(DatePart("yyyy", Date), 1, 1)
 

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