Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Set Control as Start of Current Year 2

Status
Not open for further replies.

Costefran

Technical User
Jan 2, 2008
197
0
0
GB
Can anyone help

Is there any way I can set a control of the form with the start date of the current year so if the current year is 2007 the control would show
01/01/2007

Essentially I am trying to calculate the days that have elapsed between the current date and the start of the year

Any help would be appreciated

 
Code:
Me.txtStartDate = DateSerial(Year(Date), 1, 1)

________________________________________________________
Zameer Abdulla
Help to find Missing people
 
Also...

take a look at datediff() to calculate the number of days.

Ian Mayor (UK)
Program Error
Always make your words sweet and nice. Because you never know when you may have to eat them.
 
calculate the days that have elapsed between the current date and the start of the year
=Val(Format(Date(),"y"))

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Hey PH....

Could you somehow manipulate that function to count the number of days to the end of the year?

Thanks a bunch for that equation!!

Jon
 
count the number of days to the end of the year
=DateSerial(Year(Date()),12,31)-Date()

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top