Printing the current record which has a subform

GeekyGirl

Registered User.
Local time
Today, 18:42
Joined
Apr 14, 2005
Messages
29
Hello,

I have done a search on this forum and found all the postings relating to printing only the current record for a report. I have a command button and have followed what these posts say. The report prints the current record but leaves out the data from the subform.

The database is a recipe organizer. The main form is called Recipes and the subform contains the ingredients for each recipe. This subform is called Ingredients.

I set up a command button with the following code:

Private Sub Print_Recipe_Click()
On Error GoTo Err_Print_Recipe_Click

Dim stDocName As String

stDocName = "Family Recipes"
DoCmd.OpenReport stDocName, acNormal, , "[RecipeID] = " & Forms!RECIPES![RecipeID]

Exit_Print_Recipe_Click:
Exit Sub

Err_Print_Recipe_Click:
MsgBox Err.Description
Resume Exit_Print_Recipe_Click

End Sub

Since the RecipeID is used in both forms and the report, I thought it would be the best field to use since it linked all the information together.

So what do I need to do so that the subform data prints out on the report?

Thanks
GeekyGirl
 
Rich said:
Use a subreport and link the child/master fields

I already have a subreport created with a relationship existing between the child and master fields. Is that what you meant by linking them together?
 
Please disregard my earlier post from today...I have it working now. Thanks.

GeekyGirl
 

Users who are viewing this thread

Back
Top Bottom