Strange printing behaviour

The Stoat

The Grim Squeaker
Local time
Today, 20:29
Joined
May 26, 2004
Messages
239
Hi,

Bit of an odd one here.

I have a main form with a subform -Frame1-and a treeview control. The form displayed in Frame1 changes depending on the selection made on the treeview control.

Some of the subforms are pivot tables and charts that are designed to be manipulated by the users. The only problem is that the tool bar that allows you to print them out appears to be unavailable when the are used as subforms.

The print code i've tried keeps printing the Main form including the tree view control which messes up the printed page design.

I've tried this code but with no luck. The print activation button is a selection on the tree view control as you can't add vb buttons to pivot charts and tables. See attachment. And i'm obviously trying to make the print button as generic as possible to be able to print any form contained in Frame1.

Code:
Dim stDocName As String
Dim MyForm As Form

    Set MyForm = Form_FRM_FRAME.FRAME1.Form
    stDocName = MyForm.NAME
    
    DoCmd.SelectObject acForm, stDocName, True
    DoCmd.PrintOut

I added a msgbox to tell me which form has become MyForm and it is always the form assigned to Frame1 - the sub form - so i'm not sure why it insists on printing everything :confused:

Any ideas how i can just print the subform

This is all being called from a non form module.

Any clues would be gratefully recieved.

Cheers

TS
 

Attachments

  • SkillsBox.JPG
    SkillsBox.JPG
    31.9 KB · Views: 149
Forms aren't designed with printing in mind, you're better off using a Report.
You can of course save the subform as a Report to save having to do too much design work on the Report
 
Alternatively, have the print button on the subform, and just hide it when its clicked to print(its how i got around printing a sub form)
 
Rich said:
Forms aren't designed with printing in mind, you're better off using a Report.
You can of course save the subform as a Report to save having to do too much design work on the Report

Hi Rich

The point is that pivot tables and charts are designed to be manipulated by the user then printed. As far as i am aware they are only available as forms?

Cheers TS
 
workmad3 said:
Alternatively, have the print button on the subform, and just hide it when its clicked to print(its how i got around printing a sub form)

Hi

Unfortunatley you can't display additional controls on a pivot chart/table. I tried that idea in design view but once you view it the button disappears :mad:
 

Users who are viewing this thread

Back
Top Bottom