Newbie needs vb code help for report 
Author Message
 Newbie needs vb code help for report

In my report, I have an unbound field named "FooterText". When the
report is printed (even print previewed), I want it to
1. Print 3 collated copies
2.Change the Footer text on each:
    first copy to "Sign and return with payment".
    second copy to "Keep for your records".
    third copy to "KDA copy".
3. Print the first 2 pages in color and the 3rd in monochrome.  (I don't

care if the print preview is color).

Can anyone help me with this?  The code I have so far is below.  At the
moment, I get a message that reads: "The expression On Open you entered
as the event property setting produced the following error:  Event
procedure declaration does not match description of event having the
same name."

Feel free to contact me if I've left out information that would help.
Here is the code.
=================================================================
Option Compare Database
Option Explicit

Private Sub Report_Open(Cancel As Integer, Copies As Integer)
    DoCmd.Maximize
    Copies = 1
End Sub

Private Sub Report_Page()
    DoCmd.PrintOut acPages, , , , 2, True
    End Sub
Private Sub PageFooter_Format(Cancel As Integer, FormatCount As Integer)

Select Case Copies
        Case 1
                Me!FooterText = "SIGN AND RETURN WITH PAYMENT"
        Case 2
                Me!FooterText = "KEEP FOR YOUR RECORDS"
        Case 3
                Me!FooterText = "KDA COPY"
        Case Else 'shouldn't happen
                Me!FooterText = ""
End Select
End Sub
======================================================
THANKS EVERONE!!!!!



Tue, 23 Sep 2003 03:59:53 GMT  
 Newbie needs vb code help for report
Changing the footer text is not a problem. I would suggest changing the
value of the fotter text control in the on print event.

No idea on the colour problem - sorry!

Martin Eaton



Tue, 23 Sep 2003 07:12:40 GMT  
 Newbie needs vb code help for report
Martin, thanks for your answer.  Would you look at the code in my first
post and see if you can tell what I need to do differently to get it to
print multiple copies?  At the moment, that is my chief problem.

Someone suggested that I move the footer change portion from the
PageFooter_Format event to the PageFooter_Print event.  I did that, and it
might be right.  But I'm only getting one copy when I print, so I can't
tell.  Thanks for your help.

Quote:

> Changing the footer text is not a problem. I would suggest changing the
> value of the fotter text control in the on print event.

> No idea on the colour problem - sorry!

> Martin Eaton



Tue, 23 Sep 2003 21:34:53 GMT  
 Newbie needs vb code help for report
I suggest that you configure the report to be 3 pages long, using page break
controls (Tool on the toolbar looks like "..." Then replicate the page 1
content to page 2 and 3, changing the footer text in the 'on page' event.

That would probably be the best method, because then (assuming that you have
no graphic objects), you can set ALL the controls on P2 & 3 to Black &
White.



Wed, 24 Sep 2003 06:17:03 GMT  
 Newbie needs vb code help for report
Sorry I can't be of much help.  I only can access newsgroups at home and not
from work where my reference material is.

Dev Ashish's site explains how to print multiple copies of a report at:
http://www.mvps.org/access/reports/rpt0001.htm

As for the changing of printer properties, you may want to refer to Access
97 Developer's Handbook by Getz and Litwin (NOTE: There is a 2000 version
also that will suffice.).  It should explain how to alter printer properties
via code.

--
VBNovice
MCP, VB Desktop, VB Distributed, Access


Quote:
> I suggest that you configure the report to be 3 pages long, using page
break
> controls (Tool on the toolbar looks like "..." Then replicate the page 1
> content to page 2 and 3, changing the footer text in the 'on page' event.

> That would probably be the best method, because then (assuming that you
have
> no graphic objects), you can set ALL the controls on P2 & 3 to Black &
> White.



Wed, 24 Sep 2003 06:51:28 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Need Report to look at SQL Data source ( VB / CR newbie needs help)

2. Please Help Newbie Crystal Report / VB help needed.

3. newbie needs code help for word mail merge

4. Newbie needs Code Help

5. Newbie needs code help!

6. Newbie question - need help with code

7. Newbie needs help with "findfile-code"

8. VB Newbie needs code for FTP Upload

9. total newbie here needs help with this code.

10. NEWBIE I need help with code

11. Executing shortcuts from VB4 code (newbie needs help)

12. Newbie needs help with Crystal Reports parameters

 

 
Powered by phpBB® Forum Software