[AccessD] Report Navigation on Custom Toolbar

Rocky Smolin - Beach Access Software bchacc at san.rr.com
Wed Oct 5 11:12:48 CDT 2005


A.D.:

Thanks for pointing me in the right direction.  I got the four buttons up 
there now, even edited their appearance to more mimic the standard 
navigation buttons and I point them to one of the four public functions:

Option Compare Database
Option Explicit

Public Function FirstPage()
    SendKeys "^{UP}"
End Function

Public Function PreviousPage()
    SendKeys "{UP}"
End Function

Public Function NextPage()
    SendKeys "{DOWN}"
End Function

Public Function LastPage()
    SendKeys "^{DOWN}"
End Function

Somewhere I read, however, that SendKeys is not good form, there's some 
problem with them, but I can't remember what.  You think we're safe using 
SendKeys in this limited way?  Is there an alternative?

Thanks and regards,

Rocky Smolin
Beach Access Software
http://www.e-z-mrp.com
858-259-4334

----- Original Message ----- 
From: "A.D.Tejpal" <adtp at touchtelindia.net>
To: "Access Developers discussion and problem solving" 
<accessd at databaseadvisors.com>
Sent: Tuesday, October 04, 2005 11:40 AM
Subject: Re: [AccessD] Report Navigation on Custom Toolbar


> Rocky,
>
>    As mentioned earlier, before executing SendKeys commands, compliance 
> with FitToWindow mode is ensured by code, irrespective of what the user 
> might already have done.
>
>    For inserting a command button, select ToolBox in Categories panel of 
> the customize dialog box. Select command button in Commands pane and drag 
> it to the tool bar. You can then right click the command button and either 
> paste an image or create the desired image by clicking "Edit Button 
> Image". Other properties can be set by opening the properties dialog box.
>
> Best wishes,
> A.D.Tejpal
> --------------
>
>  ----- Original Message ----- 
>  From: Rocky Smolin - Beach Access Software
>  To: Access Developers discussion and problem solving
>  Sent: Monday, October 03, 2005 20:43
>  Subject: Re: [AccessD] Report Navigation on Custom Toolbar
>
>
>  A.D.:
>
>  I have the magnifier control in my custom report toolbar.  So the user 
> can make it bigger for readability.  What happens if subsequently the user 
> magnifies the page so that it's no longer in FitToWindow mode?
>
>  Re: adding controls to the toolbar - I used customize to get the current 
> controls in the toolbar but I don't see any page navigation controls on 
> the customize form.  Am I missing something there?
>
>  Thanks and regards,
>
>  Rocky
>
>  ----- Original Message ----- 
>  From: "A.D.Tejpal" <adtp at touchtelindia.net>
>  To: "Access Developers discussion and problem solving"
>  <accessd at databaseadvisors.com>
>  Sent: Sunday, October 02, 2005 10:13 PM
>  Subject: Re: [AccessD] Report Navigation on Custom Toolbar
>
>
>  > Rocky,
>  >
>  >    That is not a problem. The code sent in my first post in this thread
>  > enforces FitToWindow mode for the report, before carrying out SendKeys
>  > command.
>  >
>  >    For adding buttons on the print preview toolbar, you have to right
>  > click on it and choose customize.
>  >
>  > Best wishes,
>  > A.D.Tejpal
>  > --------------
>  >
>  >  ----- Original Message ----- 
>  >  From: Rocky Smolin - Beach Access Software
>  >  To: Access Developers discussion and problem solving
>  >  Sent: Sunday, October 02, 2005 02:58
>  >  Subject: Re: [AccessD] Report Navigation on Custom Toolbar
>  >
>  >
>  >  A.D.:
>  >
>  >  What happens if I use the pop-up form approach and the user changes 
> the
>  > report sizing so that it no longer is in "FitToWindow" mode?
>  >
>  >  I'd like to put the navigation in the custom report toolbar I made but 
> if
>  > SendKeys won't work then that's a no go.  How do you make a custom 
> button
>  > for a toolbar anyway?
>  >
>  >  Thanks and regards,
>  >  Rocky
>  >
>  >  ----- Original Message ----- 
>  >  From: "A.D.Tejpal" <adtp at touchtelindia.net>
>  >  To: "Access Developers discussion and problem solving"
>  >  <accessd at databaseadvisors.com>
>  >  Sent: Friday, September 30, 2005 5:44 AM
>  >  Subject: Re: [AccessD] Report Navigation on Custom Toolbar
>  >
>  >  > Rocky,
>  >  >
>  >  >    It is a tiny pop-up form (similar to a tool bar) that sits in a
>  > corner of the screen. It gets opened via report's open event and closed
>  > via report's close event.
>  >  >
>  >  >    You might like to adapt the commands suitably to appropriate 
> buttons
>  > on your tool bar. In that case, the commands specific to the form (i.e.
>  > hiding / un-hiding etc) can be ignored.
>  >  >
>  >  >    After ensuring that report window is the active one and the 
> report
>  > is in FitToWindow mode, SendKeys arguments as summarized below, would 
> do
>  > the needful.
>  >  >    (a) Go to Next Page  -   "{DOWN}"
>  >  >    (b) Go to Prev Page  -   "{UP}"
>  >  >    (c) Go to Last Page   -   "^{DOWN}"
>  >  >    (d) Go to First Page  -    "^{UP}"
>  >  >
>  >  >    It is observed that SendKeys commands do not get ported smoothly 
> to
>  > tool bar functions. If you find yourself stuck on this account, and 
> wish
>  > to avoid form based solution, you could consider experimenting with
>  > fTurnPage feature available at Leban's site. For this, you would have 
> to
>  > download the file named ControlReports.zip.
>  >  >
>  >  >    Sample named ReportPreviewing.zip (by Heenan) at Roger's site, as
>  > mentioned by Ervin, represents the pop-up form approach.
>  >  >
>  >  >    If at any stage, you happen to need a simplified sample based 
> upon
>  > the code sent by me earlier, I can try to put it together.
>  >  >
>  >  > Best wishes,
>  >  > A.D.Tejpal
>  >  > --------------
>  >  >
>  >  >  ----- Original Message ----- 
>  >  >  From: Rocky Smolin - Beach Access Software
>  >  >  To: Access Developers discussion and problem solving
>  >  >  Sent: Thursday, September 29, 2005 20:05
>  >  >  Subject: Re: [AccessD] Report Navigation on Custom Toolbar
>  >  >
>  >  >  A.D.:
>  >  >
>  >  >  Thanks for the idea.  Does this mean that the report preview 
> appears
>  > in a
>  >  > pop-up or that there's a pop-up form with the navigation buttons?
>  >  >
>  >  >  I already have a custom toolbar with a minimum of controls on it -
>  > print,
>  >  > close, & fit.  I see that you can add controls for record 
> navigation.
>  >  > They look like the icons I want but of course they don't turn the 
> pages
>  > of
>  >  > a report.  I'd like to put the page navigation in the toolbar.
>  >  >  Is there a way to change the action of those icons you can put on a
>  >  > custom toolbar?  Or is there a way to create a custom button for a
>  > toolbar
>  >  > that would turn the pages of a report?
>  >  >
>  >  >  Thanks and regards,
>  >  >
>  >  >  Rocky Smolin
>  >  >  Beach Access Software
>  >  >  http://www.e-z-mrp.com
>  >  >  858-259-4334
>  >  >
>  >  >  ----- Original Message ----- 
>  >  >  From: "A.D.Tejpal" <adtp at touchtelindia.net>
>  >  >  To: "Access Developers discussion and problem solving"
>  >  >  <accessd at databaseadvisors.com>
>  >  >  Sent: Tuesday, September 27, 2005 11:00 AM
>  >  >  Subject: Re: [AccessD] Report Navigation on Custom Toolbar
>  >  >
>  >  >
>  >  >  > 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
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> 




More information about the AccessD mailing list