Printing Forms

W

Work

I have created a purchase order system in access for my work. The purchase
order is created in a form with a subform for the products. The program has
been converted to a MDE. I have a button on the form which enables user to
print a hardcopy to their machines defualt printer. I want to be able to
email the purchase order (form) as an attachment aswell as be able to print a
hard copy. Ideally I would like to hit the print button and it gives you the
option to select a printer, so users could either print a hardcopy or create
a pdf using CutePDF. I am self taught on access and normally figure away
around a problem with help of websites like this but I am struggle to find an
answer this time. Please help. Thanks in advance.
 
K

Klatuu

Forms are not really well suited to printing. I suggest you create a report
that will present the data in the same format as is on the form and print the
report instead.
You can create a report/subreport just like you do with a form/subform.
 
W

Work

I have been using the database for over a year, users input the data in a
form (which stores in the table) then print it. I do not want to lose any
data, is it possilble to create the report without losing existing orders.
 
W

Work

I did try creating a report but I keep getting all the information shown,
rather than individual purchase orders.
 
K

Klatuu

You can limit the report to the current PO in the form by using the Where
argument of the OpenReport method. It is just like the SQL WHERE clause
without the word WHERE.

For example, say the PO number is in a control on main form name txtPONumber
and the name of the field in the report's record source is PO_NUMBER, it
would look like:

If the field PO_NUMBER is a numeric field:

"[PO_NUMBER] = " & Me.txtPONumber

If it is a text field:

"[PO_NUMBER] = '" & Me.txtPONumber & "'"
 
W

Work

Thanks for your help

Klatuu said:
You can limit the report to the current PO in the form by using the Where
argument of the OpenReport method. It is just like the SQL WHERE clause
without the word WHERE.

For example, say the PO number is in a control on main form name txtPONumber
and the name of the field in the report's record source is PO_NUMBER, it
would look like:

If the field PO_NUMBER is a numeric field:

"[PO_NUMBER] = " & Me.txtPONumber

If it is a text field:

"[PO_NUMBER] = '" & Me.txtPONumber & "'"

--
Dave Hargis, Microsoft Access MVP


Work said:
I did try creating a report but I keep getting all the information shown,
rather than individual purchase orders.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top