Click to See Complete Forum and Search --> : Data report
Sheryl M
May 15th, 2001, 09:02 PM
I am making a report and I used a child command in one of the commands. The problem is during run time, I have to filter the recordset of the child command. I cannot use the filter method because I have to use BETWEEN .. AND in order to filter the child command. Is there a way to access the recordset of the child command at run time? Hope you could help me. Thanks.
Z LoveLife
May 16th, 2001, 08:26 AM
What VB does when you use a child command is it creates a shape command such as the following
SHAPE {select * from [parent table]
"where [some field] = ? } ' ? = parameter marker
as ParentCMD <==== the parent chapter name
APPEND ({select * from [child table]
where somefield = ?
and otherfield between ? and ?}
RELATE [Location Id] to [Location Id]) <== join criteria
as ChildCMD
when it uses the shape command it will expect 4 parameters passed in which you define on the
parameters tab under the parent and child command properties. Then all you need to do is pass the parameters in when you set the command up.
ie
DECommand.parentcommand parameter1
DECommand.childcommand parameter1,parameter2,parameter3
there's an example of setting up the parameters at this site http://www.zarr.net/vb/download/sourcecode.asp
look for Dynamic report 2.
Hope this helps. If I haven't been clear ask again.
Sheryl M
May 16th, 2001, 10:34 PM
I would like to ask some things about the code excerpts you cited.
For the
SHAPE {select * from [parent table] "where [some field] = ? } ' ? = parameter marker
as ParentCMD <==== the parent chapter name APPEND ({select * from [child table] where somefield = ? and otherfield between ? and ?}
RELATE [Location Id] to [Location Id]) <== join criteria as ChildCMD
how will i put this in my code? do I have to declare an object (i.e. command) then use the execute method to do this?
as for the
DECommand.parentcommand parameter1
DECommand.childcommand parameter1,parameter2,parameter3
what is DECommand? How will the parentcommand and childcommand appear?
please elaborate more on how i will use the tips you have given. Thank you.
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.