View Full Version : filters


PaulaDavies
08-23-2000, 07:02 AM
On my form there is a command button that when it is pressed i want it to run a report for records between certain dates.
And then print out another letter depending on a field for that record.

eg
one report lists all students who skipped to class in the week, and the other lists there details and how many classes they missed.

Jack Cowley
08-23-2000, 08:16 AM
I would suggest the following - Create a query and use the Between And statement in the criteria column with the date. On your form put two unbound text boxes. Maybe they could be called StartDate and EndDate. Now the syntax for the Between And statement on the query would look like this:

Beween [Forms]![YourFormName]![StartDate] And [Forms]![YourFormName]![EndDate]

Base your report on the query. On your form fill in the two fields with dates you are intrested in and the with your command button open the report. It will print the data that you want.

The next bit was to print a letter based on a field in the query. In the same code of the command button after the Print Report business use DLookup to see it the field you are interested in contains the data that determines if a letter is sent. If you get the right answer then Print the letter, otherwise exit your subroutine....

I hope this all made sense to you...

Jack