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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing information on a form's Subform

Status
Not open for further replies.

billheath

Technical User
Mar 17, 2000
299
US
I need to print out the information in a subform on the current form page. The printout method does not allow the selection of a particular record. The print button wizard put in this code:

Dim stDocName As String
Dim MyForm As Form

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

Unfortunately, this prints out every form in "Mysubform"! I only want the info from the current record.
Thanks, Bill Heath
 
change to:

DoCmd.PrintOut acSelection

hope this works for you
 
fmbpcsup, I tried acSelection. It only allowed me to select the number of pages that would be printed. I need to be able to selct which record will be printed based on the original form. Thanks, bill
 
what about changing stDocName to the name of your mainform?
That should print the form's current record and the displayed subform records.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top