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
|