Looking for the wright expression as criteria

odrap

Registered User.
Local time
Today, 08:47
Joined
Dec 16, 2008
Messages
156
For archiving purposes i have a sub into which by mean of a appendquery records of a table who met a certain condition are appended to another table who serves as archivetable.
After appending the records to the archivetable, the same records are deleted in the original table by mean of a deletequery.
Now I want to change this code in such a way that i can use it each new year ,by just entering two numbers in a the textbox of a criteriaform, e.g. 08. The code must accept this criteria and on base of it,append all records who has a date = "2008" to a archivetable . What's the right expression in this case that I must use as criteria in the where clause of the queries? Suppose that this archivesub is called as click event of a button on the criteriaform.
 
To extract the Year from a date field use:

Code:
Year([MyDateField])

So the criteria woudl be something like:

Code:
Where Year([MyDateField]) = Forms![MyForm].txtYear
 
Thank you very much for the help.


Greetings from Brugge in Belgium
 

Users who are viewing this thread

Back
Top Bottom