Printing form with current record

  • Thread starter Thread starter John
  • Start date Start date
J

John

Hi

If I have a form open, what is the code that is equivalent to using the
File->Print menu with select record(s) option to print the form with the
currently displayed record values?

Thanks

Regards
 
In general, it's best to create a report for printing. You can then
precisely control how the print should be laid out. If it helps, you can
save the form as a report (File | Save As, in design view) to give you a
running start.

You can then use the primary key value in the form to identify the record to
be printed. Example code in:
Print the record in the form
at:
http://allenbrowne.com/casu-15.html
 
Hi Allen

Thanks for that but the client want a simple dump of the form with the
currently displayed record. I figured If I could automate the File-Print
command with Selected Record(s) option that'll do the trick.

Thanks

Regards
 
Try:
RunCommand acCmdSelectRecord
DoCmd.PrintOut acSelection

I hate to even tell you how to do something that badly, though. :-)
 
Back
Top