/* */

Wednesday, December 9, 2009

[belajar-access] Event waktu Print

----- Original Message -----
From: "Ivan Leonardo" <ivan@pttdp.com>
To: <belajar-access@yahoogroups.com>
Sent: Wednesday, December 09, 2009 9:43 AM
Subject: Re: [belajar-access] Event waktu Print


> exz@nt wrote:
> >
> >
> > kalo dibuat 2 button gmn ?
> > button Preview & Print
> > flag cm ditaruh di button Print sj..
> >
> >
> Thanks utk idenya, sy dapat jawaban dari forum luar mungkin bermanfaat
>
> On a report already open in print preview mode, you wish to log the
> print action only if the user has actually gone ahead with final OK in
> print dialog box. If at any stage, the user cancels the print dialog
> box, there should be no activation of print logging routine.
>
> Considering the fact that report header's print event fires afresh for
> each new print-out, your objective can be met by monitoring the print
> event for report header from the second occurrence onwards.
>
> Let F_Report be the name of calling form. Place an unbound text box
> named TxtPreview on this form. Code in click event of command button
> named CmdReport would be as follows:
>
> ' Code in form's module
> '===========
> =======================
> Private Sub CmdReport_Click()
> Me.TxtPreview = Null
> DoCmd.OpenReport "<<NameOfMyReport>>", _
> acViewPreview, , "MyCriteria"
> DoCmd.Maximize
> DoCmd.RunCommand acCmdZoom100
> End Sub
> '==================================
>
> The code in print event of report header section would be as follows:
>
> ' Code in report's module
> '==================================
> Private Sub ReportHeader_Print(Cancel As Integer, _
> PrintCount As Integer)
> With Forms("F_Report")
> If !TxtPreview = "Y" Then
> CurrentDb.Execute "<<SQL_ForActionQuery>>", _
> dbFailOnError
> Else
> !TxtPreview = "Y"
> End If
> End With
> End Sub
> '==================================

No comments:

Post a Comment