A.D.Tejpal
adtp at touchtelindia.net
Tue Sep 27 13:00:36 CDT 2005
Rocky,
Sample code in the module of a pop-up form, as given below, enables page navigation of report named R_Test. Command button named CmdNext steps forward through the pages while that named CmdPrev does the reverse.
You might like to adapt it suitably for your specific situation.
Note - For the SendKeys command (Up or Dn arrow) to be effective, it is necessary that report is in FitToWindow mode and report's window is the active one.
Best wishes,
A.D.Tejpal
--------------
Code module for Pop Up Form
================================
' Declarations Section
Private RepHdw As Long, FrmHdw As Long
Private Declare Function BringWindowToTop Lib "user32" _
(ByVal hwnd As Long) As Long
--------------------------------------------------------
Private Sub CmdNext_Click()
DoCmd.Echo False
Me.Visible = False
BringWindowToTop RepHdw
DoCmd.RunCommand acCmdFitToWindow
SendKeys "{DOWN}", True
DoCmd.RunCommand acCmdZoom100
Me.Visible = True
BringWindowToTop FrmHdw
DoCmd.Echo True
End Sub
Private Sub CmdPrev_Click()
DoCmd.Echo False
Me.Visible = False
BringWindowToTop RepHdw
DoCmd.RunCommand acCmdFitToWindow
SendKeys "{UP}", True
DoCmd.RunCommand acCmdZoom100
Me.Visible = True
BringWindowToTop FrmHdw
DoCmd.Echo True
End Sub
Private Sub Form_Activate()
DoCmd.Restore
End Sub
Private Sub Form_Load()
RepHdw = Reports("R_Test").hwnd
FrmHdw = Me.hwnd
End Sub
================================
----- Original Message -----
From: Rocky Smolin - Beach Access Software
To: AccessD at databaseadvisors.com
Sent: Monday, September 26, 2005 23:41
Subject: [AccessD] Report Navigation on Custom Toolbar
Dear List:
I have a custom toolbar for reports that get displayed in report preview if the db is an mde. It has only printer icon, close button, and zoom control. The paging navigation is of course, at the lower left of the screen in preview mode, but I'm wondering if these nav buttons can be added to the custom toolbar where an inexperienced user might be more likely to see them.
MTIA,
Rocky Smolin
Beach Access Software
http://www.e-z-mrp.com
858-259-4334