Printing One Page of a Report

  • Thread starter Lori2836 via AccessMonster.com
  • Start date
L

Lori2836 via AccessMonster.com

I have a command button on my main form, to print one page of the
corresponding report. It works fine, other than the fact that instead of
only printing the page once, it prints it about 25 times. Please see the
code below for the Print command button. Can you tell me what is wrong,
that its printing the same page so many times, instead of just once?


Private Sub cmdPrint_Click()

Dim strDocName As String
Dim strWhere As String
strDocName = "rptFace Sheet to be reviewed"
strWhere = "[ID] = " & Me.[ID]
DoCmd.OpenReport strDocName, acViewNormal, , strWhere


End Sub


Thanks for any help!
Lori
 
J

John

Just a comment... I never use a command button that goes
directly to print, in case the report is not what I want

Instead, I always go to preview and print from there
DoCmd.OpenReport stReportName, acPreview

Adds an extra step, but might help your problem
 
F

fredg

I have a command button on my main form, to print one page of the
corresponding report. It works fine, other than the fact that instead of
only printing the page once, it prints it about 25 times. Please see the
code below for the Print command button. Can you tell me what is wrong,
that its printing the same page so many times, instead of just once?

Private Sub cmdPrint_Click()

Dim strDocName As String
Dim strWhere As String
strDocName = "rptFace Sheet to be reviewed"
strWhere = "[ID] = " & Me.[ID]
DoCmd.OpenReport strDocName, acViewNormal, , strWhere


End Sub

Thanks for any help!
Lori

I would suggest, whenever you post a question, you include your Access
version number. Sometimes the version makes a difference in the
answer.
1) There is nothing in the above code to cause the report to print 25
times.
Your difficulty is elsewhere.

2) If a query is the report's record source, I would first exam the
query. If it's returning more records (duplicated ones) than it
should, you most likely have not established the correct table
relationships.

3) Do you have code elsewhere in the form like
DoCmd.PrintOut
that calls for 25 copies to print?
 

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