browse: forums | FAQ
Connecting Tech Pros Worldwide

Hey there! Do you need Microsoft Access / VBA help?

Get answers from our community of Microsoft Access / VBA experts on BYTES! It's free.

On Print Event

lee123's Avatar
Site Addict
 
Join Date: Feb 2007
Location: United States
Posts: 537
#1: Mar 6 '08
hi all, i have a report i have made and a form that goes with it in my form i have a check box field that is "PAID" so when the user checks it on the report will say "Paid" on it with a label i have made for it. now how can i get the report to print 2 invoices one that says "Paid" and one that says "File". i was looking at the report properties and i have found a event called "OnPrint" how would i use this to my advantage to get it to print 2 that says all of that? can this be done or is there another solution?

just so you know what i have in the label i have this:

Expand|Select|Wrap|Line Numbers
  1. Private Sub GroupHeader0_Format(Cancel As Integer, FormatCount As Integer)
  2.  
  3.     If IsPaid Then
  4.         orderstatuslabel.Caption = "PAID"
  5.     Else
  6.         orderstatuslabel.Caption = "PENDING"
  7.     End If
  8.  
  9. End Sub
i don't know if this will help!

lee123



mshmyob's Avatar
Expert
 
Join Date: Jan 2008
Location: witness protection
Posts: 645
#2: Mar 6 '08

re: On Print Event


There are many ways to do it but you could try putting your code in the 'ON FORMAT' event instead of the 'ON PRINT' event.

Let me know if that works. If it doesn't work let me know and I will give you some other suggestions.

cheers,

Quote:

Originally Posted by lee123

hi all, i have a report i have made and a form that goes with it in my form i have a check box field that is "PAID" so when the user checks it on the report will say "Paid" on it with a label i have made for it. now how can i get the report to print 2 invoices one that says "Paid" and one that says "File". i was looking at the report properties and i have found a event called "OnPrint" how would i use this to my advantage to get it to print 2 that says all of that? can this be done or is there another solution?

just so you know what i have in the label i have this:

Expand|Select|Wrap|Line Numbers
  1. Private Sub GroupHeader0_Format(Cancel As Integer, FormatCount As Integer)
  2.  
  3.     If IsPaid Then
  4.         orderstatuslabel.Caption = "PAID"
  5.     Else
  6.         orderstatuslabel.Caption = "PENDING"
  7.     End If
  8.  
  9. End Sub
i don't know if this will help!

lee123

lee123's Avatar
Site Addict
 
Join Date: Feb 2007
Location: United States
Posts: 537
#3: Mar 7 '08

re: On Print Event


maybe you misunderstood me but i want to know how i can get two invoices to print one that says "paid" and the other to say "file"

The example code i put in my last post is what i have in a label that happens when i click on the checkbox on the form then when i click the print button on the form it lets me to preview the report before i print it and the invoice says "paid" for when it's checked and "pending" when it's not checked.

but is there a way to get the printer to print 2 invoice by code to print one for "paid" and the other to print "file". i think i said that right? sorta for one invoice for me (file) and the other for the customer (paid)

lee123
mshmyob's Avatar
Expert
 
Join Date: Jan 2008
Location: witness protection
Posts: 645
#4: Mar 7 '08

re: On Print Event


Ok. You will need to send the print job twice. After the first print job change the control to say 'file'.

Quote:

Originally Posted by lee123

maybe you misunderstood me but i want to know how i can get two invoices to print one that says "paid" and the other to say "file"

The example code i put in my last post is what i have in a label that happens when i click on the checkbox on the form then when i click the print button on the form it lets me to preview the report before i print it and the invoice says "paid" for when it's checked and "pending" when it's not checked.

but is there a way to get the printer to print 2 invoice by code to print one for "paid" and the other to print "file". i think i said that right? sorta for one invoice for me (file) and the other for the customer (paid)

lee123

Reply