A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Print preview last page..



 
 
Thread Tools Display Modes
  #1  
Old December 31st, 2008, 08:12 AM posted to microsoft.public.access.gettingstarted
Richard
external usenet poster
 
Posts: 1,419
Default Print preview last page..

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.
  #2  
Old December 31st, 2008, 10:10 AM posted to microsoft.public.access.gettingstarted
Wayne-I-M
external usenet poster
 
Posts: 3,674
Default Print preview last page..

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:

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.

  #3  
Old December 31st, 2008, 08:32 PM posted to microsoft.public.access.gettingstarted
Richard
external usenet poster
 
Posts: 1,419
Default Print preview last page..

Awesome thank you, could you talk a little about the 2 sendkeys lines and
how I could use that.

"Wayne-I-M" wrote:

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:

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.

  #4  
Old January 1st, 2009, 10:00 AM posted to microsoft.public.access.gettingstarted
Wayne-I-M
external usenet poster
 
Posts: 3,674
Default Print preview last page..

Sendkeys are (very simply) a code that repreents you hitting a key on the
keyboard.

Open the code window and press F1 help and search sendkey and you will get
lots of examples of keys






--
Wayne
Trentino, Italia.



"Richard" wrote:

Awesome thank you, could you talk a little about the 2 sendkeys lines and
how I could use that.

"Wayne-I-M" wrote:

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:

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.

  #5  
Old January 2nd, 2009, 12:11 AM posted to microsoft.public.access.gettingstarted
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Print preview last page..

On Thu, 1 Jan 2009 02:00:00 -0800, Wayne-I-M
wrote:

Sendkeys are (very simply) a code that repreents you hitting a key on the
keyboard.

Open the code window and press F1 help and search sendkey and you will get
lots of examples of keys


It should be noted that Sendkeys is generally recommended only as a last-ditch
choice when there's NO other way to do it; the problem is that you have no
guarantee that the key value being sent will get to the right destination. If
you have multiple windows open, the character may end up in some other
application.
--

John W. Vinson [MVP]
  #6  
Old January 2nd, 2009, 11:08 AM posted to microsoft.public.access.gettingstarted
Wayne-I-M
external usenet poster
 
Posts: 3,674
Default Print preview last page..

Thanks for that John

I would think that it should be possible to check for other open "stuff" and
close them on some OnClick or warn to user then, if nothing is open then run
the code. But I can't see the OP's application and we don't have enough
details for this.

Is there another method of previewing on open the last page of a report
without using sendkeys?

PS - happy New Year

--
Wayne
Trentino, Italia.



"John W. Vinson" wrote:

On Thu, 1 Jan 2009 02:00:00 -0800, Wayne-I-M
wrote:

Sendkeys are (very simply) a code that repreents you hitting a key on the
keyboard.

Open the code window and press F1 help and search sendkey and you will get
lots of examples of keys


It should be noted that Sendkeys is generally recommended only as a last-ditch
choice when there's NO other way to do it; the problem is that you have no
guarantee that the key value being sent will get to the right destination. If
you have multiple windows open, the character may end up in some other
application.
--

John W. Vinson [MVP]

  #7  
Old January 2nd, 2009, 05:53 PM posted to microsoft.public.access.gettingstarted
Richard
external usenet poster
 
Posts: 1,419
Default Print preview last page..

I would welcome other methods of print preview the last page also. If the
sendkeys are known to have problems.

Thanks Richard





"Wayne-I-M" wrote:

Thanks for that John

I would think that it should be possible to check for other open "stuff" and
close them on some OnClick or warn to user then, if nothing is open then run
the code. But I can't see the OP's application and we don't have enough
details for this.

Is there another method of previewing on open the last page of a report
without using sendkeys?

PS - happy New Year

--
Wayne
Trentino, Italia.



"John W. Vinson" wrote:

On Thu, 1 Jan 2009 02:00:00 -0800, Wayne-I-M
wrote:

Sendkeys are (very simply) a code that repreents you hitting a key on the
keyboard.

Open the code window and press F1 help and search sendkey and you will get
lots of examples of keys


It should be noted that Sendkeys is generally recommended only as a last-ditch
choice when there's NO other way to do it; the problem is that you have no
guarantee that the key value being sent will get to the right destination. If
you have multiple windows open, the character may end up in some other
application.
--

John W. Vinson [MVP]

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:20 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.