Need to create a sub-report that prints from within the main repor

G

Guest

I'm somewhat new to Access 2000, so please bare with me... I have created a
purchase order database in Access 2000 that includes two main tables,
"Orders" and "Order Details", and a number of support tables such as the
"Vendor Details", "Employees" and "Shipping Companies" tables. To enter data
into these tables, I have created one main form that gathers all the "Orders"
table and most of the support tables data through bound controls. Also
included in the main form is a sub-form that gathers each line item in the
"Order Details" table.

I don't need to print out the report (should be in a typical Purchase Order
format) at any time other than when I have the main form open and finished
entering a particular order (single OrdersID). So I created a report from
scratch using controls that pulled data from the loaded form, which works
almost perfectly, as long as the form is still loaded. However, using this
method, I can only print out the order details (or purchase order line item)
for whichever single record is showing on the sub-form at the time, or
otherwise only one record in the "Order Details" table for that order prints.
How do I get all the order details records for that particular order to
print using this report format, or do I have to create my report using data
pulled directly from the tables or queries, and not using the form data at
all? Does anyone have a sample purchase order or invoice database and
reports that I could get and study the coding?
 
A

Allen Browne

Use a query as the source for you report.
In the query, include both the Orders and Order Details table.
You don't need a subreport.

Use the OrderID in the form to print out just that order. Details in:
Print the record in the form
at:
http://members.iinet.net.au/~allenbrowne/casu-15.html

If you need another example, open the Northwind sample database, the Orders
form, and look how the Print Invoice button works.
 

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