Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing Pages

Status
Not open for further replies.

pollenman

Technical User
Dec 13, 2000
68
0
0
GB
I have a command button that when pressed prints the current record, howevwer it runs the report header page as well. How can I prevent this from happening.

Thanks in advance

Terry
 
pollenman said:
howevwer it runs the report header page as well
Can you please elaborate this by giving some more information on this?


Zameer Abdulla
[sub]Jack of Visual Basic Programming, Master in Dining & Sleeping[/sub]
Visit Me
 
It runs the first page (front cover) of the report which gives details of the report.
 
I am not quite understand the problem
anyway can you look at the code behind the command button and post here to see what is that?

Zameer Abdulla
[sub]Jack of Visual Basic Programming, Master in Dining & Sleeping[/sub]
Visit Me
 
Private Sub Command19_Click()
On Error GoTo Err_Command19_Click

DoCmd.OpenReport "BQAsset", , , "[BranchID] =" & Forms![Branch Detail]![BranchID] & ""

Exit_Command19_Click:
Exit Sub

Err_Command19_Click:
MsgBox Err.Description
Resume Exit_Command19_Click

End Sub
 
If you don't want a report header, then don't have one. from menu = VIEW+REPORT HEADER AND FOOTER...uncheck it.

Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
If your report has many pages and you want only a single page from the range to be printed then use something like this. You have to paly with it..

Code:
Private Sub Command19_Click()
On Error GoTo Err_Command19_Click

DoCmd.OpenReport "BQAsset",[b]acViewPreview[/b] , , "[BranchID] =" & Forms![Branch Detail]![BranchID] & ""
[b]DoCmd.PrintOut acPages, 2, 2[/b] 'Page range
Exit_Command19_Click:
    Exit Sub

Err_Command19_Click:
    MsgBox Err.Description
    Resume Exit_Command19_Click
    
End Sub
Hope this helps

Zameer Abdulla
[sub]Jack of Visual Basic Programming, Master in Dining & Sleeping[/sub]
Visit Me
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top