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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Entering form field for previous calendar year 1

Status
Not open for further replies.

osi2301

Programmer
Jul 3, 2004
75
AU
I have a form called 'Occurrences' with a subForm called 'OccurrencesSub'.

On the form I have two fields, one is called 'Begin' date and the other is called 'End' date. The user may enter the beginning and ending dates directly into the fields or select an option button what will populate the two fields when they select 'Year to Date', 'Last 30 days' and 'Previous Calendar Year'. The form uses the dates to search the records and display the records on the SubForm.

The 'Previous Calendar Year' is giving me the problem. I want to automatically populate the two fields with the 1 Jan to 31 Dec dates of the previous year when that option button is selected by the user.

I have looked everywhere on the net. Can anyone help?
 
How about:

[tt]CDate(Year(Date)-1 & "/01/01")
CDate(Year(Date)-1 & "/12/31")[/tt]

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top