By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,966 Members | 1,145 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,966 IT Pros & Developers. It's quick & easy.

Printing form with current record

P: n/a
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
Nov 16 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
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

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"John" <Jo**@nospam.infovis.co.uk> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...

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?

Nov 16 '05 #2

P: n/a
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

"Allen Browne" <Al*********@SeeSig.Invalid> wrote in message
news:43**********************@per-qv1-newsreader-01.iinet.net.au...
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

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"John" <Jo**@nospam.infovis.co.uk> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...

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?


Nov 16 '05 #3

P: n/a
Try:
RunCommand acCmdSelectRecord
DoCmd.PrintOut acSelection

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

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"John" <Jo**@nospam.infovis.co.uk> wrote in message
news:jP******************************@pipex.net...

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.

"Allen Browne" <Al*********@SeeSig.Invalid> wrote in message
news:43**********************@per-qv1-newsreader-01.iinet.net.au...
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

"John" <Jo**@nospam.infovis.co.uk> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...

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?

Nov 16 '05 #4

P: n/a
Thanks for this. Any way to select the printer and/or page orientation
before printing?

"Allen Browne" <Al*********@SeeSig.Invalid> wrote in message
news:43**********************@per-qv1-newsreader-01.iinet.net.au...
Try:
RunCommand acCmdSelectRecord
DoCmd.PrintOut acSelection

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

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"John" <Jo**@nospam.infovis.co.uk> wrote in message
news:jP******************************@pipex.net...

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.

"Allen Browne" <Al*********@SeeSig.Invalid> wrote in message
news:43**********************@per-qv1-newsreader-01.iinet.net.au...
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

"John" <Jo**@nospam.infovis.co.uk> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...

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?


Nov 17 '05 #5

P: n/a
Try:
RunCommand acPrint

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"John" <Jo**@nospam.infovis.co.uk> wrote in message
news:Cs********************@pipex.net...
Thanks for this. Any way to select the printer and/or page orientation
before printing?

"Allen Browne" <Al*********@SeeSig.Invalid> wrote in message
news:43**********************@per-qv1-newsreader-01.iinet.net.au...
Try:
RunCommand acCmdSelectRecord
DoCmd.PrintOut acSelection

I hate to even tell you how to do something that badly, though. :-)
"John" <Jo**@nospam.infovis.co.uk> wrote in message
news:jP******************************@pipex.net...

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.

"Allen Browne" <Al*********@SeeSig.Invalid> wrote in message
news:43**********************@per-qv1-newsreader-01.iinet.net.au...
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

"John" <Jo**@nospam.infovis.co.uk> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
>
> 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?



Nov 17 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.