From: JohnE on
Have a situation in which the printing (on paper) needs to have recorded the
date the printing occurred. This would mainly be a field on the form that
says when the report was printed. It won't make a difference how many times
the report is printed so long as the date appears in a field. The users use
the standard Access 2007 printing methods to print the report so adding a
PRINT button on a form or the report is not acceptable.

Is is possible to capture A2007's print button? If so, how is it done? Any
samples, examples, or links will be helpful.

Thanks.... John
From: Mike Painter on
JohnE wrote:
> Have a situation in which the printing (on paper) needs to have
> recorded the date the printing occurred. This would mainly be a
> field on the form that says when the report was printed. It won't
> make a difference how many times the report is printed so long as the
> date appears in a field. The users use the standard Access 2007
> printing methods to print the report so adding a PRINT button on a
> form or the report is not acceptable.
>
> Is is possible to capture A2007's print button? If so, how is it
> done? Any samples, examples, or links will be helpful.
>
> Thanks.... John

Back in the old days....

I used to pop a message asking if the printing had been a success rather
than just mark something printed.
It's a rare problem today but I still use it.

Something like
If MsgBox("Did everything print OK?", vbYesNo, "Continue")= vbYes Then
Me.YourFieldName = Date()
End If

You could also use Now() to save the time and date.

You will have to change the way 2007 writes these buttons and make sure it
writes code rather than a macro. (Although it can probably be done with a
macro.)

Click the Access button and select "Access Options" at the bottom right of
the screen.


From: JohnE on


"Mike Painter" wrote:

> JohnE wrote:
> > Have a situation in which the printing (on paper) needs to have
> > recorded the date the printing occurred. This would mainly be a
> > field on the form that says when the report was printed. It won't
> > make a difference how many times the report is printed so long as the
> > date appears in a field. The users use the standard Access 2007
> > printing methods to print the report so adding a PRINT button on a
> > form or the report is not acceptable.
> >
> > Is is possible to capture A2007's print button? If so, how is it
> > done? Any samples, examples, or links will be helpful.
> >
> > Thanks.... John
>
> Back in the old days....
>
> I used to pop a message asking if the printing had been a success rather
> than just mark something printed.
> It's a rare problem today but I still use it.
>
> Something like
> If MsgBox("Did everything print OK?", vbYesNo, "Continue")= vbYes Then
> Me.YourFieldName = Date()
> End If
>
> You could also use Now() to save the time and date.
>
> You will have to change the way 2007 writes these buttons and make sure it
> writes code rather than a macro. (Although it can probably be done with a
> macro.)
>
> Click the Access button and select "Access Options" at the bottom right of
> the screen.
>
>
> .
>

Thanks. The message box trick could work. Since it is the Access printing
that is doing the work of printing the Access report, where do you place the
msgbox? Also, I looked at the Access Options but what in particular should I
be looking for?
Thanks again.
John
From: Mike Painter on
JohnE wrote:
> "Mike Painter" wrote:
>
>> JohnE wrote:
>>> Have a situation in which the printing (on paper) needs to have
>>> recorded the date the printing occurred. This would mainly be a
>>> field on the form that says when the report was printed. It won't
>>> make a difference how many times the report is printed so long as
>>> the date appears in a field. The users use the standard Access 2007
>>> printing methods to print the report so adding a PRINT button on a
>>> form or the report is not acceptable.
>>>
>>> Is is possible to capture A2007's print button? If so, how is it
>>> done? Any samples, examples, or links will be helpful.
>>>
>>> Thanks.... John
>>
>> Back in the old days....
>>
>> I used to pop a message asking if the printing had been a success
>> rather than just mark something printed.
>> It's a rare problem today but I still use it.
>>
>> Something like
>> If MsgBox("Did everything print OK?", vbYesNo, "Continue")= vbYes
>> Then Me.YourFieldName = Date()
>> End If
>>
>> You could also use Now() to save the time and date.
>>
>> You will have to change the way 2007 writes these buttons and make
>> sure it writes code rather than a macro. (Although it can probably
>> be done with a macro.)
>>
>> Click the Access button and select "Access Options" at the bottom
>> right of the screen.
>>
>>
>> .
>>
>
> Thanks. The message box trick could work. Since it is the Access
> printing that is doing the work of printing the Access report, where
> do you place the msgbox? Also, I looked at the Access Options but
> what in particular should I be looking for?
> Thanks again.
> John

I thought it could be done globally but can't find where.
http://office.microsoft.com/en-us/access/ha012142131033.aspx#convertmacrostovba
will guide you through converting and it works on forms.

When done you will have something like what is below and the Msgbox would be
right under the DoCmd.OpenReport.


Private Sub Command105_Click()
On Error GoTo Command105_Click_Err

DoCmd.OpenReport "Products", acViewPreview, "", "", acNormal

Command105_Click_Exit:
Exit Sub

Command105_Click_Err:
MsgBox Error$
Resume Command105_Click_Exit

End Sub