Print out contents of sub-form.

IfButOnly

Registered User.
Local time
Tomorrow, 10:36
Joined
Sep 3, 2002
Messages
236
I have a form with sub-forms. I want the user to have the option of printing out the contents of the sub-form before emailing it. I tried the PRINT command button (DoCmd.Printout) but it prints the whole form, not just the sub-form.

Does anyone know how I could best do this?
 
I don't know if it will work, but one method may be to open a second occurence of the subform briefly to the current record then print and close.
 
Use a report and the Where argument
 
Rich, The report idea would be ideal as it would allow me to add additional text around the form (Heading, date etc).

However, the sub-form is used to enter comments for email and will not be saved - ie it is unbound. How do I get the report to pick up that info or build the Where clause?

Thanks .... PeteR.
 
Set a text box control source on the report to =MyForm!MySubForm!MyField, provided the form remains open while the report is running you should be ok. Use the code builder to get the correct form references
 

Users who are viewing this thread

Back
Top Bottom