Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I filter child records in a Datareport

Status
Not open for further replies.

tedsmith

Programmer
Nov 23, 2000
1,762
AU
I have an 'Special Orders report' derived from 4 tables in a heirachy as follows-
Table1 has ID, CustomerName, Address
Table2 has ID, OrderNumber, OrderItem, Date, TotalPayment
Table3 has ID, OrderItem, OrderNumber, Cost, Date
Table4 has ID, OrderItem, SpecialThings, Date

Table 4 only has an entry for some customers who need something different

I set up the data report in 3 child levels
Parent has SQL Joined tables 1 & 2, Parameter = Date
Child1 is Table2
Child2 is Table3
Child3 is Table4

I had to join 1 & 2 to make the parameter work.

This shows everything nicely grouped in 4 grouping levels as some customers might have more items in their order than others.
My problem how do I show only the Customers who have a specialthing and hide the others who have none? The only reference to specialthing is in table 4
 
If you are using the report form, I would suggest using the print when button for the field.

If not then use a subset select for your specialthingy.

Dancing is easy. Now dancing on a floating raft in the middle of an October storm in the middle of the North Atlantic, that is hard.
 
Thanks but how do I get at the print when button?
Im using the Datareport that comes with VB6

If I use a select SQL for the specialthingy Child3 it does not have any effect in stopping records that dont contain an entry for a specialthingy in table 4. I can stop child records but I cant stop parent records that dont have a child! (which is what I want to do)

I think need to get control at the parent level somehow.
I tried joining up table 4 to the parent SQL but is just shows no records at all. (WHERE Table4.SpecialThingy >' ')

Also there doesnt seem to be any way of altering some records on the fly like you can in Access with a function in the Access routine that fires every time you print each record. Do you know if this is possible?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top