Codes to print only the form without the subform or only page 1 of a form

C

Céline Brien

Hi !
I used the assistant to create a button to print the current form.
I would like to print only the form, not the subform.
Can I add codes to the codes below to print only the current form
without the subform or only the page 1 of the current form ?
Many thanks,
Céline
------------------------------------------------------------------------
Private Sub Commande231_Click()
On Error GoTo Err_Commande231_Click


DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.PrintOut acSelection

Exit_Commande231_Click:
Exit Sub

Err_Commande231_Click:
MsgBox Err.Description
Resume Exit_Commande231_Click

End Sub
 
G

Guest

Try changing the DoCmd.Printout line to the following:

DoCmd.Printout acPages, 1, 1

That should print just the first page. Your subform may still print,
however, if it falls on the first page.
 
M

Marshall Barton

Céline Brien said:
I used the assistant to create a button to print the current form.
I would like to print only the form, not the subform.
Can I add codes to the codes below to print only the current form
without the subform or only the page 1 of the current form ?


Not a profitable exercise. Forms are for editing/viewing
data. Reports are for formating and printing the data.
 
G

Guest

Hi Mike,
Thank you very much for your answer.
It work just fine !
Have a good day.
Céline
 
C

Céline Brien

Hi Marsh !
You are absolutely right !
Thank you for this "rappel à l'ordre".
Between you and me, to print a form to put in the member, client or
employee file is not a big sin ;-) is it ???
Céline
 
M

Marshall Barton

No, it not a sin at all. Since the primary functionality of
forms is not intended for printing, it's just a pain to get
it right. I guess they can be better than a screen shot,
but not by a lot. Besides, creating simple reports is
pretty easy so why not use them.
 

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