hi, can someone help me with this, it's my first time using shape statement and i'm confused. i'm using a vb6 program and access database

i want to do a shape statement where the parent has a child and the child has another child, and there is parameters passed to the parent

i had this done in dataenvirenment and now i'm converting it to a shape statment

here is the parent sql statment i used in dataenvirement

select * from tblCustomer, tblVisit where strVisitStatus <> 'Cancelled' and dtDate = ? and dtLastVisit =? and intTicketNum = intTicketNumb

where i pass the date and a number to it

the child sql statement is

select * from tblVisit order by intVisitNum Desc
the relation ship between the child and the parent is
intticketNum to intTicketNumb

the child of the child sql statment is

select * from tblJobOrder
relation ship between this child and the one before it is
tblJobOrder.visitID to tblVisit.visitID

i need to know how to set up this shape statment and how to execute it, and how do i pass the parameters to it, what i'm gonna pass to it is a values of text boxes. also how to connect it to the report afterwards