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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|