View Single Post
  #2 (permalink)  
Old April 9th, 2007, 06:31 AM
mmcdonal mmcdonal is offline
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Before you do either of these functions, take the year in a variable and pass it to the function.

dtCurYear = DatePart("yyyy", Date())

For example when you open the data entry form, set the filter to the current year, or if it is based on a query, pass the year to the query(WHERE [dtYear] = " & dtCurYear

Allow users to open the form for previous years, but on that button, pass WHERE [dtYear] <> " & dtCurYear.

You may have to add date ## signs before and after. And of course you will want to date stamp every record with the current year. It is easier if you store the year by itself in a seperate field as I have done, but you can also just add a date created field, pass the current date to it, and check the year datepart of that field.

Did this help?




mmcdonal