previewing only some of the reports to send

  • Thread starter Thread starter leahf via AccessMonster.com
  • Start date Start date
L

leahf via AccessMonster.com

I have a separate report of monthly teacher hours for each teacher. When the
reports are to be sent to the teachers, any teacher with an e-mail address
will get the form by e-mail. For all teachers in the system without an e-
mail address, the report will be printed.

If I request a teacher's report with an e-mail address, it is sent by e-mail.

If I request a teacher's report without an e-mail address, it shows up on the
preview screen.
Perfect so far.

When I request all the teacher reports...
while I will (using msgbox) see that only those teachers without an e-mail
address go to the acPreview, in actuality, when I go through the preview
screen, all of the teacher reports are there.

Do all reports get previewed no matter what?

Leah
 
The report needs to be filtered to include only the teachers you want for
each run. If you have a field that contains the teachers' E-Mail addresses,
This will include only teachers with E-Mail address:

WHERE [EmailAddr] IS NOT NULL

And for those without:

WHERE [EmailAddr] IS NULL
 
That is what I did but it doesn't seem to work. The example I used had 8
teachers. 6 of them had e-mail addresses.

I could see on the screen that the report was sent 6 times and I could see
the preview screen popping up twice. It seemed perfect - except when I
looked at the preview screen, I was able to see all 8 reports.

The script is basically this:

If InStr(1, rs1!teacher_email, "@") > 0 Then
DoCmd.SendObject....
else
DoCmd.OpenReport "rpt_teacherMonthlyForm", acPreview
end if

Thanks for any help that you can give.
Leah
The report needs to be filtered to include only the teachers you want for
each run. If you have a field that contains the teachers' E-Mail addresses,
This will include only teachers with E-Mail address:

WHERE [EmailAddr] IS NOT NULL

And for those without:

WHERE [EmailAddr] IS NULL
I have a separate report of monthly teacher hours for each teacher. When the
reports are to be sent to the teachers, any teacher with an e-mail address
[quoted text clipped - 15 lines]
 
Back
Top