FoxProProgrammer
Programmer
Hi folks,
I am designing a Form that allows users to select one of several reports, and output the report either to the printer or screen preview. The user can select the report and output destination via Option groups. The Form also has two text boxes where the user can enter a start date (startdate) and end date (enddate) for the report. These dates restrict the records that appear in the report. The Form has a Print button that opens the correct report and directs the output to the correct location. Here is the syntax for one of the reports:
DoCmd.OpenReport "Production Run Summary", IIf(where.Value = 1, acViewPreview, acViewNormal), , (Date > Forms!Print!startdate.Value) And (Date <= Forms!Print!enddate.Value)
The Report, "Production Run Summary" is based on a Query, and one of it's columns (fields) is named "Date". When I run the program, all the records are included in the report instead of the ones between the dates specified by startdate and enddate. Any ideas what I am doing wrong?
Thanks,
dz
dzaccess@yahoo.com
I am designing a Form that allows users to select one of several reports, and output the report either to the printer or screen preview. The user can select the report and output destination via Option groups. The Form also has two text boxes where the user can enter a start date (startdate) and end date (enddate) for the report. These dates restrict the records that appear in the report. The Form has a Print button that opens the correct report and directs the output to the correct location. Here is the syntax for one of the reports:
DoCmd.OpenReport "Production Run Summary", IIf(where.Value = 1, acViewPreview, acViewNormal), , (Date > Forms!Print!startdate.Value) And (Date <= Forms!Print!enddate.Value)
The Report, "Production Run Summary" is based on a Query, and one of it's columns (fields) is named "Date". When I run the program, all the records are included in the report instead of the ones between the dates specified by startdate and enddate. Any ideas what I am doing wrong?
Thanks,
dz
dzaccess@yahoo.com