Print SubForm Data

A

Antonio

I have a subform and I would like to print the customers'
data, but when I print, the form is actually printing, not
the data. Of course, I don't want to put actual data in
the code, so if anyone could help, it would be
appreciated. The code I have now (with data) is:

If O1062.Visible Then
stDocName = "O1062"
Set MyForm = Screen.ActiveForm
DoCmd.SelectObject acForm, stDocName, True
DoCmd.PrintOut
DoCmd.SelectObject acForm, MyForm.Name, False
ElseIf O1085.Visible Then
stDocName = "O1085"
Set MyForm = Screen.ActiveForm
DoCmd.SelectObject acForm, stDocName, True
DoCmd.PrintOut
DoCmd.SelectObject acForm, MyForm.Name, False
ElseIf O1057.Visible Then
stDocName = "O1057"
Set MyForm = Screen.ActiveForm
DoCmd.SelectObject acForm, stDocName, True
DoCmd.PrintOut
DoCmd.SelectObject acForm, MyForm.Name, False
ElseIf O1021.Visible Then
stDocName = "O1021"
Set MyForm = Screen.ActiveForm
DoCmd.SelectObject acForm, stDocName, True
DoCmd.PrintOut
DoCmd.SelectObject acForm, MyForm.Name, False

End If
 
R

Rick Brandt

Antonio said:
I have a subform and I would like to print the customers'
data, but when I print, the form is actually printing, not
the data. Of course, I don't want to put actual data in
the code, so if anyone could help, it would be
appreciated. The code I have now (with data) is:

Forms suck at printing. Use Reports.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top