Printing report from form action

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How do you make a from frint a report only when a new record is added or if
the record is changed, but not when the record is viewed. I would like it to
be automatic to a specified printer, so how do I add an option for the user
to use the same printer everytime they use this form without selecting it
from the printer options everytime a record is added? Other forms use a
different printer!
 
To print the record in the form, create a report that has the desired
layout. If the layout is close to what you already have in the form, you can
open the form in Design view, choose Save As from the File menu, and save
the form as a report.

Now add some code to the AfterInsert event of the form if you only want to
print it when a new record is added, or to the AfterUpdate event of the form
if you want to print it whenever a change is saved.

For an example of how to print just the record in the form, see:
Print the record in the form
at:
http://members.iinet.net.au/~allenbrowne/casu-15.html

If you have the printer installed on the machine where you have developed
this code, you can open the report in design view, choose Page Setup from
the File menu, and designate a specific printer for this report.

If you want the user to be able to select one of their printers at runtime -
even a printer that you do not have installed on your development machine -
and have the report remember print to that printer, see:
Printer Selection Utility
at:
http://members.iinet.net.au/~allenbrowne/AppPrintMgt.html
 
Thank you for your help! I tried to open the Access 2000 version, but it
errors out like it is not on that webpage anymore. I will use yours for my
2002 clients. However, there are only four different print drivers (the user
will have one of the four for the label printer) that the client side will
have on there computer, so is there a way to have the reports find one of the
four drivers so the user doesn't have to selct the printer from the list for
the 2000 version?
 
Back
Top