Group:  Microsoft Access ยป microsoft.public.access.gettingstarted
Thread: Print preview last page..

Print preview last page..
Richard 12/31/2008 8:12:12 AM
I would like to preview the last page im my report:

Private Sub Command13_Click()
On Error GoTo Err_Command13_Click

Dim stDocName As String

stDocName = "rptScanlog"
DoCmd.OpenReport stDocName, acPreview

Exit_Command13_Click:
Exit Sub

Err_Command13_Click:
MsgBox Err.Description
Resume Exit_Command13_Click

End Sub

Thanks and happy new year to all.
RE: Print preview last page..
Wayne-I-M 12/31/2008 10:10:01 AM
Private Sub ButtonName_Click()
Dim I As Integer
DoCmd.OpenReport "ReportName", acViewPreview
I = Reports!ReportName.Pages
SendKeys "{F5}{Delete}"
SendKeys I & "{ENTER}"
End Sub

Change ButtonName and ReportName to what they are in your application


Happy New Year


--
Wayne
Trentino, Italia.



"Richard" wrote:

[Quoted Text]
> I would like to preview the last page im my report:
>
> Private Sub Command13_Click()
> On Error GoTo Err_Command13_Click
>
> Dim stDocName As String
>
> stDocName = "rptScanlog"
> DoCmd.OpenReport stDocName, acPreview
>
> Exit_Command13_Click:
> Exit Sub
>
> Err_Command13_Click:
> MsgBox Err.Description
> Resume Exit_Command13_Click
>
> End Sub
>
> Thanks and happy new year to all.

Home | Search | Terms | Imprint
Newsgroups Reader