Go Back   Access World Forums > Microsoft Access Discussion > Forms

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 01-21-2003, 12:57 PM   #1
reel knotty
Member
 
Join Date: Jun 2002
Location: lititz, pa
Posts: 71
Thanks: 0
Thanked 0 Times in 0 Posts
reel knotty
Send a message via AIM to reel knotty
Angry printing subforms

Ok guys Heres the skinny...
I am working on a form with 2 subforms. The form is to be used as a confirmation print out. Problem is when I try to print the form it only prints (or displays in preview) the parent form and no information of the child forms.

As always any input is greatly appreciated!

Nate

__________________
Reel Knotty
NJStriper.com

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

People for Eating Tasty Animals [PETA]
reel knotty is offline   Reply With Quote
Old 01-21-2003, 08:02 PM   #2
Pat Hartman
Super Moderator
 
Join Date: Feb 2002
Location: Stratford,Ct USA
Posts: 28,316
Thanks: 15
Thanked 1,601 Times in 1,520 Posts
Pat Hartman is a name known to all Pat Hartman is a name known to all Pat Hartman is a name known to all Pat Hartman is a name known to all Pat Hartman is a name known to all Pat Hartman is a name known to all
Forms are not optimized for printing. And due to the nature of subforms, Access cannot print them.

Create a report with subreports. In your print button, use the OpenReport Method. Use the where argument to supply the key of the main report record.
Pat Hartman is offline   Reply With Quote
Old 01-21-2003, 08:04 PM   #3
wizcow
Registered User
 
wizcow's Avatar
 
Join Date: Sep 2001
Location: B.C. Canada
Posts: 236
Thanks: 0
Thanked 1 Time in 1 Post
wizcow is on a distinguished road
Nate

The printing of forms is troublesome business.

Your best bet is to make a Report.
Have your print button open the Report and have the Report's control source be tied to a query that looks up the information on your form.

HTH
Tom

wizcow is offline   Reply With Quote
The Following User Says Thank You to wizcow For This Useful Post:
CJW (08-17-2016)
Old 01-22-2003, 05:21 AM   #4
reel knotty
Member
 
Join Date: Jun 2002
Location: lititz, pa
Posts: 71
Thanks: 0
Thanked 0 Times in 0 Posts
reel knotty
Send a message via AIM to reel knotty
Thanks Guys! I ended up creating a report from the form. I know it is not the normal way but some of the info on the subforms I wanted to print is not related after it is entered.


Thanks again for the tip!!
__________________
Reel Knotty
NJStriper.com

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

People for Eating Tasty Animals [PETA]
reel knotty is offline   Reply With Quote
Old 03-30-2003, 05:18 AM   #5
Timbo99
Junior Member
 
Join Date: Mar 2003
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Timbo99
Thumbs up This Works

I use a command button on the subform (printer icon).. set it's properties to visible 'screen only'. now paste this code into the buttons 'on click'



Dim stDocName As String
Dim MyForm As Form

stDocName = "subformname"
Set MyForm = Screen.ActiveForm
DoCmd.SelectObject acForm, stDocName, True
DoCmd.PrintOut
DoCmd.SelectObject acForm, MyForm.Name, False



Works for me!
Timbo99 is offline   Reply With Quote
Old 10-01-2019, 03:02 PM   #6
Mr. Southern
Newly Registered User
 
Join Date: Aug 2019
Location: United States
Posts: 71
Thanks: 11
Thanked 0 Times in 0 Posts
Mr. Southern is on a distinguished road
Re: This Works

Quote:
Originally Posted by Timbo99 View Post
I use a command button on the subform (printer icon).. set it's properties to visible 'screen only'. now paste this code into the buttons 'on click'



Dim stDocName As String
Dim MyForm As Form

stDocName = "subformname"
Set MyForm = Screen.ActiveForm
DoCmd.SelectObject acForm, stDocName, True
DoCmd.PrintOut
DoCmd.SelectObject acForm, MyForm.Name, False



Works for me!


I know this thread is really old but what would you need to change if you wanted to print it in landscape view?
Mr. Southern is offline   Reply With Quote
Old 10-01-2019, 03:45 PM   #7
Mark_
Longboard on the internet
 
Join Date: Sep 2017
Location: Not the middle of no where, but I can see the road to it from my house.
Posts: 2,112
Thanks: 20
Thanked 400 Times in 393 Posts
Mark_ will become famous soon enough Mark_ will become famous soon enough
Re: printing subforms

Open the report in design view.
Click on the "Page Setup"
In "Page Layout" select "Landscape"

Mark_ is offline   Reply With Quote
Old 10-01-2019, 05:49 PM   #8
Mr. Southern
Newly Registered User
 
Join Date: Aug 2019
Location: United States
Posts: 71
Thanks: 11
Thanked 0 Times in 0 Posts
Mr. Southern is on a distinguished road
Re: printing subforms

Quote:
Originally Posted by Mark_ View Post
Open the report in design view.
Click on the "Page Setup"
In "Page Layout" select "Landscape"
I am printing a form.
Mr. Southern is offline   Reply With Quote
Old 10-01-2019, 08:35 PM   #9
Mark_
Longboard on the internet
 
Join Date: Sep 2017
Location: Not the middle of no where, but I can see the road to it from my house.
Posts: 2,112
Thanks: 20
Thanked 400 Times in 393 Posts
Mark_ will become famous soon enough Mark_ will become famous soon enough
Re: printing subforms

I'd create a report to do what you need as they are actually for printing, but if that isn't an option, check out THIS THREAD and see if it answers your question.

Mark_ is offline   Reply With Quote
The Following User Says Thank You to Mark_ For This Useful Post:
Mr. Southern (10-02-2019)
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump




All times are GMT -8. The time now is 03:29 AM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World