Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing a Viewed Report using Runtime

Status
Not open for further replies.

cjowsey

IS-IT--Management
Nov 17, 2002
95
AU
I have a problem which is frustrating me enormously. I am developing an ADP to use the runtime version of Access. Several reports have been designed to be shown in preview mode and printed if the user requires. I have created a print menu to bring up with the reports (runtime disables the standard Print Preview right click menu). Now I am having real trouble getting the report to take the focus and keep the menu on top at the same time.

Has anybody else been through this situation before? If so, how did you solve it?
 
It is a menubar. I used the code below
Code:
'****************************************************************
' This procedure creates a new toolbar.
'****************************************************************
Public Sub AddPrintCommandBar()
    Dim CBar As CommandBar
    Dim CBarCtl As CommandBarControl
   
   On Error GoTo AddNewCB_Err

    ' Create a new floating toolbar and make it visible.
    Set CBar = CommandBars.Add(Name:="Print Options", _
                Position:=msoBarFloating, MenuBar:=False, Temporary:=True)
    CBar.Visible = True
    
    With CBar
        ' Create the buttons.
        Set CBarCtl = .Controls.Add(msoControlButton, CommandBars("File") _
            .Controls("Page Setup...").ID)
         .Controls(1).Style = msoButtonIconAndCaption
        Set CBarCtl = .Controls.Add(msoControlButton, CommandBars("File") _
            .Controls("Save As...").ID)
         .Controls(2).Style = msoButtonIconAndCaption
        Set CBarCtl = .Controls.Add(msoControlButton, CommandBars("File") _
            .Controls("Export...").ID)
         .Controls(3).Style = msoButtonIconAndCaption
         .Controls(3).Caption = "Export..."
        Set CBarCtl = .Controls.Add(msoControlButton, CommandBars("File") _
            .Controls("Print...").ID)
         .Controls(4).Style = msoButtonIconAndCaption
         .Controls(4).OnAction = "ReportPrint"
    End With
    
    Exit Sub
   
AddNewCB_Err:
   MsgBox "Error " & Err.Number & vbCr & Err.Description
   Exit Sub
End Sub




 
I've got to use a floating or pop up menu because the user wants all the forms to be fullscreen (docmd.maximise). This means I don't have an MDI frame to dock on so top and bottom menus can't be seen.

Thanks for your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top