Print page 1 of a report

C

Céline Brien

Hi,
By clicking on a button in a form, I preview a report.
I would like to obtain the printing of the first page of the report.
The codes to preview are below.
Many thanks,
Céline
Using Access 97
------------------------------------------------

Private Sub ImprimerEPlaintes_Click()
On Error GoTo Err_ImprimerEPlaintes_Click


Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "EPlaintes"
stLinkCriteria = "[NoMembre]=" & Me![NoMembre]
DoCmd.OpenReport stDocName, acPreview, , stLinkCriteria


Exit_ImprimerEPlaintes_Click:
Exit Sub

Err_ImprimerEPlaintes_Click:
MsgBox Err.Description
Resume Exit_ImprimerEPlaintes_Click

End Sub
 
F

fredg

Hi,
By clicking on a button in a form, I preview a report.
I would like to obtain the printing of the first page of the report.
The codes to preview are below.
Many thanks,
Céline
Using Access 97
------------------------------------------------

Private Sub ImprimerEPlaintes_Click()
On Error GoTo Err_ImprimerEPlaintes_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "EPlaintes"
stLinkCriteria = "[NoMembre]=" & Me![NoMembre]
DoCmd.OpenReport stDocName, acPreview, , stLinkCriteria

Exit_ImprimerEPlaintes_Click:
Exit Sub

Err_ImprimerEPlaintes_Click:
MsgBox Err.Description
Resume Exit_ImprimerEPlaintes_Click

End Sub

Look up the PrintOut method in VBA help.

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "EPlaintes"
stLinkCriteria = "[NoMembre]=" & Me![NoMembre]
DoCmd.OpenReport stDocName, acPreview, , stLinkCriteria
DoCmd.PrintOut acPages, 1, 1
etc.
 
C

Céline Brien

Hi Fred,
It works !
Thank you.
PrintOut method. It is noted.
Have a good day.
Céline

fredg said:
Hi,
By clicking on a button in a form, I preview a report.
I would like to obtain the printing of the first page of the report.
The codes to preview are below.
Many thanks,
Céline
Using Access 97
------------------------------------------------

Private Sub ImprimerEPlaintes_Click()
On Error GoTo Err_ImprimerEPlaintes_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "EPlaintes"
stLinkCriteria = "[NoMembre]=" & Me![NoMembre]
DoCmd.OpenReport stDocName, acPreview, , stLinkCriteria

Exit_ImprimerEPlaintes_Click:
Exit Sub

Err_ImprimerEPlaintes_Click:
MsgBox Err.Description
Resume Exit_ImprimerEPlaintes_Click

End Sub

Look up the PrintOut method in VBA help.

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "EPlaintes"
stLinkCriteria = "[NoMembre]=" & Me![NoMembre]
DoCmd.OpenReport stDocName, acPreview, , stLinkCriteria
DoCmd.PrintOut acPages, 1, 1
etc.
 

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