Pulling data from a subform to a report

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

OK, I have a subform that contains product information for a purchase order.
Some orders have more than one item. I would like to pull all items for a
single purchase order over to a report. It is only pulling the top item now.
Please Help!

Thanks!
 
To start you need a TblPO and a TblPODetails. Then either directly or via a
query, you need a main report based on TblPO and a subreport based on
TblPODetails.
 
I did this and it pulls all purchase orders that have been created. How can
I pull just the information for the most recent order?

Thanks!
 
Base the main report on a query that contains all the fields you need for
the main report including PODate. Go to the query in design view and click
on the Sigma (looks loke E) button on the toolbar at the top of the screen.
Under PODate, change Group By to Max. You may need another criteria such as
specifying a specific customer if there are more than one POs written on the
most recent date. Now run your report.
 
I created a report based on the the main Purchase Order table which I have
working correctly. I created a subreport based on the Order details table.
It pulls all the order details information. If I scroll through these on the
report, I see that it is pulling the instances where there is more than one
product so that is what I need. I just need it to pull just the details for
that specific purchase order. I have tried several ways to base the
subreport on the main report with the Purchase Order number but it's still
pulling not tied to the main report.

Thanks!
 
Your Order table and OrderDetails table should have a relationship typically
on a field named OrderID. Open your main report and select the subreport
control. Open properties and go to the Data tab. You will see the LinkMaster
and LinkChild properties. Together these make the subreport track the main
report. Your descrription of what is happening says these properties are
blank. Click on the three dots at the right. That will start the wizard and
it should automatically put OrderID in both properties.
 
Thank you for your help. I have the main report and subreport working
correctly now. I have the Group By settings to show the most recent PO by PO
number. But a popup box comes up asking for the PO number. Once the user
enters this in, it brings up the report correctly. Can I eliminate having
the user enter in the PO number? Also, when I go to print, it prints all the
PO's (hundreds of them). How can I change it to print the most current one
without having to set it in Print settings. In other words, can I have it
pull up the most recent PO and that's it, not all the others? Thank you
again for your help!
 
Back
Top