473,511 Members | 17,486 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Printing form with current record

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
5 2604
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
4834
by: Jody Gelowitz | last post by:
I am having a problem with printing selected pages. Actually, the problem isn't with printing selected pages as it is more to do with having blank pages print for those pages that have not been...
4
9335
by: John | last post by:
Hi Is there a way to print/e-mail the current record as it appears on a form? Thanks Regards
4
4702
by: Sami | last post by:
I hope someone will tell me how to do this without having to do any VB as I know nothing in that area. I am a rank beginner in using Access. I have created a database consisting of student...
5
2196
by: bobh | last post by:
Hi All, A clients database (built by another and not very well but, its what I have to work with) has bound forms that display customer information and when printed is three pages long. The...
4
6144
by: paquer | last post by:
Hello' How do I get the subform to print along with the main form? I want my user's to be able to go in the field with a printout of the info they need to populate in the database. So when they...
1
6933
by: paquer | last post by:
I have forms that are used in the office as well as in the field. I want user's to be able to print out an exact copy of the form for "in the field" data entry. (Yes we are still stuck in the 90's....
2
1917
by: Robert | last post by:
I have a form with a print button on it which opens a report. I specify the id in the where clause in the OpenReport statemt say the report prints for the current record. This works fine for...
3
2487
by: Dave | last post by:
Hello! What's the best way to make a button print *just* the selected (displayed) record of a subform, when that subform is currently part of a larger form? Thanks!
0
2822
it0ny
by: it0ny | last post by:
Hi guys, thanks I am fairly new to this forum so I hope I chose the right place to post this question. I try to make my program printout a deposit's report. I created a class to store the...
0
7356
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7512
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5671
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5069
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4741
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3227
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3214
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
785
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
449
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.