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

Printing a Form

P: n/a
This is probably very simple but:

How do I print an open form to the default printer. I want the user to
click a button on the form and have it print without them having to
bother with the print dialogue box.

Thanks in advance.
Nov 13 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Forms are for viewing and interacting with data. Reports are for
printing.

Create a report based on the form (and its recordsource) and then just
simply open it. You probably want just the record being viewed to
print. If so then you would simply supply the PK (or unique ID) as the
Where argument of the DoCmd.OpenReport function.

DoCmd.OpenReport "rptMyReport",,,"ThePK = " & Me.ThePK

- Jim
On 27 May 2004 15:25:39 -0700, cq*******@volcanomail.com (Wayne
Aprato) wrote:
This is probably very simple but:

How do I print an open form to the default printer. I want the user to
click a button on the form and have it print without them having to
bother with the print dialogue box.

Thanks in advance.


Nov 13 '05 #2

P: n/a
Jim Allensworth wrote:
Forms are for viewing and interacting with data. Reports are for
printing.

Create a report based on the form (and its recordsource) and then just
simply open it. You probably want just the record being viewed to
print. If so then you would simply supply the PK (or unique ID) as the
Where argument of the DoCmd.OpenReport function.

DoCmd.OpenReport "rptMyReport",,,"ThePK = " & Me.ThePK

- Jim
On 27 May 2004 15:25:39 -0700, cq*******@volcanomail.com (Wayne
Aprato) wrote:
This is probably very simple but:

How do I print an open form to the default printer. I want the user
to click a button on the form and have it print without them having
to bother with the print dialogue box.

Thanks in advance.


Crt-P manually...

Or try Docmd.Printout ? (mental block!)

--
regards,

Bradley
Nov 13 '05 #3

P: n/a
Hi Jim. As you correctly point out "Forms are for viewing and
interacting with data. Reports are for printing".

The reason that I need to print the form is that there appears to be
no way of setting the "TOP" parameter in the sql statement of a query
so that the parameter is passed into the sql statement from an
external input eg. a textbox on a form.

Given that there appears to be no way of doing this, I have written
the sql statement into the code behind my form with the "TOP"
parameter being supplied from another form.

It would indeed be far simpler if I could have a report based on a
query.

Regards.
Nov 13 '05 #4

P: n/a
Hi Wayne,
I'm not sure how you are using the TOP predicate and what results you
are looking for. However, you could use a saved QueryDef for the
recordsource of the report. Then - just prior to opening the report -
set the SQL property of the Query in code. In effect the Query is
simply a shell for the RecordSource of the report which you can change
when you need to.

- Jim

On 29 May 2004 23:53:15 -0700, cq*******@volcanomail.com (Wayne
Aprato) wrote:
Hi Jim. As you correctly point out "Forms are for viewing and
interacting with data. Reports are for printing".

The reason that I need to print the form is that there appears to be
no way of setting the "TOP" parameter in the sql statement of a query
so that the parameter is passed into the sql statement from an
external input eg. a textbox on a form.

Given that there appears to be no way of doing this, I have written
the sql statement into the code behind my form with the "TOP"
parameter being supplied from another form.

It would indeed be far simpler if I could have a report based on a
query.

Regards.


Nov 13 '05 #5

P: n/a
Thanks Jim. I'll give it a try.
Nov 13 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.