Knowing what you've printed

G

Guest

This is probably an odd question... Before our big fund-raising event, our
non-profit solicits donations. We gather names from past donors and from our
members. I've created an access database that tracks the donors/potential
donors. We send out letters in "batches"- when we get the names,
essentially. So, I'm wondering how I keep from sending the first batch of
letters out everytime I send out the following batch of letters.

I thought about a flag on the form and having the underlying report query
skip if the flag is yes. But not sure how to automate... Any suggestions
appreciated...
 
L

Linda Burnside

Hi Stephanie,

I set up a similar application which used a date field ... Maybe you can add
a DateLtrSent field to your table? An advantage of the date as opposed to a
Yes/No check box would be that you would have relevant information with
regard to this year, last year or some previous date.

Linda
 
G

Guest

Interesting!
But how do you track what you've printed? I don't want to print the report
and then go back into the form to enter the "DateLtrSent"- that seems time
consuming. Were you able to automatically populate DateLtrSent when you
print the letter? Seems cool but perhaps not possible...
--
Thanks for the help!



Linda Burnside said:
Hi Stephanie,

I set up a similar application which used a date field ... Maybe you can add
a DateLtrSent field to your table? An advantage of the date as opposed to a
Yes/No check box would be that you would have relevant information with
regard to this year, last year or some previous date.

Linda
 
L

Linda Burnside

You could run the report from a form button. When the user clicks the
button, the result would be to (1) run the report and (2) run a query which
changes the date.

Linda



Stephanie said:
Interesting!
But how do you track what you've printed? I don't want to print the
report
and then go back into the form to enter the "DateLtrSent"- that seems time
consuming. Were you able to automatically populate DateLtrSent when you
print the letter? Seems cool but perhaps not possible...
 
F

fredg

This is probably an odd question... Before our big fund-raising event, our
non-profit solicits donations. We gather names from past donors and from our
members. I've created an access database that tracks the donors/potential
donors. We send out letters in "batches"- when we get the names,
essentially. So, I'm wondering how I keep from sending the first batch of
letters out everytime I send out the following batch of letters.

I thought about a flag on the form and having the underlying report query
skip if the flag is yes. But not sure how to automate... Any suggestions
appreciated...

1) Add a new field to your table... Date/Time datatype. Name it
"DateSent".

Add a Group Header and a Group Footer to your report on the DonorID
field. Set the Group Header Force New Page property to Before Group.
(This will assure only one Donor on each page.)
Add the [DonorID] control to the group header (or in the Detail
Section). (You can make it not visible and close up the height of the
header and footer if you don't need to print those.)

Code the report's Declarations section and the Activate event and
GroupFooter Format events exactly as below:
Note: Your GroupFooter number may be different than mine. Use yours.

Option Compare Database
Option Explicit
Dim intPreview As Integer
---------------------
Private Sub GroupFooter0_Format(Cancel As Integer, FormatCount As
Integer)

If intPreview = 0 Then
Dim strSQL As String
strSQL = "Update YourTableName Set YourTableName.DateSent= #" _
& Date & "# Where YourTableName.[ID] = " & [ID] & ";"

CurrentDb.Execute strSQL, dbFailOnError
End If

End Sub
------------------------------
Private Sub Report_Activate()
intPreview = -1
End Sub
--------------------

Change the table name and field names in the strSQL above to match
what your actual table and field names are.

To actually print the report...`
Open the report from a command button on a form:

DoCmd.OpenReport "ReportName", acViewNormal, , "[DateSent] Is Null"

The above will print out and place the date in the table field for
that record.

Only records that do NOT have a date in the DateSent field will print.

If you Preview the report, the above records will NOT be updated, even
if you then click print from the preview window.

Caution: Be aware that though you have sent the report to the printer,
there is no guarantee that the reports have all been successfully
printed. Printers do run out of ink, paper, etc., or just die of old
age. :-(

Have fun....
 
G

Guest

fredg,
Thanks for the suggestions and great code.
I'm still trying to figure out what I want to do, which I know is frustrating.
About once a year, we go through this begging for money process. We'll flag
some of the donors as those that we want to contact for the next year. So, if
I use DateSent is null then for the following year, those that I've flagged
as AskAgain (yes) wouldn't get printed. Any way around this?

--
Thanks for the help!



fredg said:
This is probably an odd question... Before our big fund-raising event, our
non-profit solicits donations. We gather names from past donors and from our
members. I've created an access database that tracks the donors/potential
donors. We send out letters in "batches"- when we get the names,
essentially. So, I'm wondering how I keep from sending the first batch of
letters out everytime I send out the following batch of letters.

I thought about a flag on the form and having the underlying report query
skip if the flag is yes. But not sure how to automate... Any suggestions
appreciated...

1) Add a new field to your table... Date/Time datatype. Name it
"DateSent".

Add a Group Header and a Group Footer to your report on the DonorID
field. Set the Group Header Force New Page property to Before Group.
(This will assure only one Donor on each page.)
Add the [DonorID] control to the group header (or in the Detail
Section). (You can make it not visible and close up the height of the
header and footer if you don't need to print those.)

Code the report's Declarations section and the Activate event and
GroupFooter Format events exactly as below:
Note: Your GroupFooter number may be different than mine. Use yours.

Option Compare Database
Option Explicit
Dim intPreview As Integer
---------------------
Private Sub GroupFooter0_Format(Cancel As Integer, FormatCount As
Integer)

If intPreview = 0 Then
Dim strSQL As String
strSQL = "Update YourTableName Set YourTableName.DateSent= #" _
& Date & "# Where YourTableName.[ID] = " & [ID] & ";"

CurrentDb.Execute strSQL, dbFailOnError
End If

End Sub
------------------------------
Private Sub Report_Activate()
intPreview = -1
End Sub
--------------------

Change the table name and field names in the strSQL above to match
what your actual table and field names are.

To actually print the report...`
Open the report from a command button on a form:

DoCmd.OpenReport "ReportName", acViewNormal, , "[DateSent] Is Null"

The above will print out and place the date in the table field for
that record.

Only records that do NOT have a date in the DateSent field will print.

If you Preview the report, the above records will NOT be updated, even
if you then click print from the preview window.

Caution: Be aware that though you have sent the report to the printer,
there is no guarantee that the reports have all been successfully
printed. Printers do run out of ink, paper, etc., or just die of old
age. :-(

Have fun....
 
F

fredg

fredg,
Thanks for the suggestions and great code.
I'm still trying to figure out what I want to do, which I know is frustrating.
About once a year, we go through this begging for money process. We'll flag
some of the donors as those that we want to contact for the next year. So, if
I use DateSent is null then for the following year, those that I've flagged
as AskAgain (yes) wouldn't get printed. Any way around this?

Please always include the relevant part of any previous post. Someone
who is reading this for the first time what no idea what you are
referring to. I had to go back to the previous post to remember what
this is about,

As an example to open the report.

Docmd.OpenReport, "Reportname",acViewNormal, , "[DateSent] Is Null Or
[DateSent] < DateSerial(Year(Date()),1,1)"

It will send to all new donors that have not yet been sent letters or
where the DateSent field is before Jan,1st of that current year.

You can change the date to any other portion of the year you want,
i.e. < DateSerial(Year(Date()),6,15) for June 15th of th current year.

so that it is the date on which you sent that year's first batch of
letters. Letters marked before that will be sent. Letters after that
date will not.

I'm sure there are other methods as well.
 
G

Guest

Thanks for the suggestions. I'll try out the code.
I haven't used the group since the big update. Before others yelled at me
for not deleting parts of the message!
--
Thanks for the help!



fredg said:
fredg,
Thanks for the suggestions and great code.
I'm still trying to figure out what I want to do, which I know is frustrating.
About once a year, we go through this begging for money process. We'll flag
some of the donors as those that we want to contact for the next year. So, if
I use DateSent is null then for the following year, those that I've flagged
as AskAgain (yes) wouldn't get printed. Any way around this?

Please always include the relevant part of any previous post. Someone
who is reading this for the first time what no idea what you are
referring to. I had to go back to the previous post to remember what
this is about,

As an example to open the report.

Docmd.OpenReport, "Reportname",acViewNormal, , "[DateSent] Is Null Or
[DateSent] < DateSerial(Year(Date()),1,1)"

It will send to all new donors that have not yet been sent letters or
where the DateSent field is before Jan,1st of that current year.

You can change the date to any other portion of the year you want,
i.e. < DateSerial(Year(Date()),6,15) for June 15th of th current year.

so that it is the date on which you sent that year's first batch of
letters. Letters marked before that will be sent. Letters after that
date will not.

I'm sure there are other methods as well.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top