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.
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
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
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
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