Subreport

G

Guest

Hi all.
I have created a Report which acts a Till Receipt in a local Minimart, I now
need to include a Subreport to display all the items the customer has bought.
I want this data to be taken from a Subform on a Transaction Form. I have
tried the Subreport command and using the existing Subform but in Print
Preview it displays all Transactions. I only want to show what the Customer
has bought not everyone. It needs to be filtered somehow by the TransactionID.

This should be something so simple but has turned annoying for me!
Any help would be appreciated...
 
A

Al Campagna

Buckaroo,
Your form should be a One to Many realtionship related by TransactionID. Each Item
purchased should have it's own unique key field (autonumber) AND also include the
TransactionID it is associated with.
Given a TransactionID of 123 on the main form, and a table of Purchases in the subform,
and a Parent/Child relationship bewteen main and sub of TransactionID, every Purchase
record entered under 123 will have it's TransactionID automatically updated to 123.
Access handles this because of the Parent/Child relationship.
Main..........tblTransacations
TransID Date
123 1/1/06
|
| < ParentChild Link on Form
|
Sub......... tblPurchases
TransID PurchaseID Item Price
123 10792 Candy .25
123 10793 Coffee 1.00
123 10794 Gum .30 etc.. etc...

Now, a filter on the report of TransactionID = 123 will only return this transaction, and
the associated Purchases.
 
G

Guest

I have already done what you said, but the TransactionID is always changing,
the value has to be taken from the Form or it can also be taken from the Main
Report. There is no specific criteria, as it needs to be inserted
automatically.
 
A

Al Campagna

Place this criteria in the query behind the report... against the TransactionID field...
(use your own names)
= Forms!frmYourTransactionFormName!TransactionID
 

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