Data Environment and passing parameters to child commands

Data Environment and passing parameters to child commands

Post by Jona » Sat, 25 May 2002 21:56:35

I have a question regarding parameters to child commands in the
DataEnvironment. I will try to explain the problem with a simple

The relation is ID = ID ofcourse.
I would like to use the same report to show:
  1) PetOwner and his/hers pets with an age < 2 (Or with an age <
  2) PetOwner and his/hers pets with name = 'Peter'
  3) PetOwner and his/hers pets with Gender = male

1) Is it possible to have some variables/parameters for this or do I
have to do three different reports?
    (This wont solve the problem with the parameter in report #1)

   I know how to use parameters in the 'parent' command. My problem is
that I would like to pass the parameters to the child command.
   In this way I would be able to use the same commands & report to
make different reports depending on the parameters.

   The obvious solution is to make more commands and reports. (They
will be almost identical. But I will not be able to make 'dynamic'
querys like I want.) This is something that I would like to avoid.

2) I could manage to do what I want if I could change the CommandText
of the child command. (CommandText~=SQL command)
   I know how to set the CommandText of the 'parent', but I cannot do
it for the child command.

   This is how I do it for the 'parent' command:
     DataEnv.Commands("cmdPetOwner").CommandText = "SELECT * FROM

   Is there anyone that knows how to find and change the child
CommandText and parent relations?

3) I could add a new table that contains the parameters.
   I would have to insert the parameters into this new table prior to
running the command/report.
   The command would have to look at this table to get the parameters.
   I would like to avoid this if it's possible.

Is there anyone that has had the same problem? And maybe a/the


1. 2nd Request - Passing parameters to ADO Data Environment command

I have set up an insert query with parameters via the Data Environment
designer and despite my best efforts can't seem to find any (concise)
documentation on how to pass data into the parameters on the VB side and
update the DB record.

Command name is MyNewRecord

 INSERT INTO MyTable(Field1, Field2, Field3) VALUES (?, ?, ?)

Parameter names : Param1, Param2, Param3

VB stuff: DataEnvironment1.MyNewRecord()

Where do you go from here?

2. VB6 vs Access2000

3. Showing parameters pass to data environment in data report header

4. Licensing issues with Oracle and WWW applications


6. Data Environment Deisnger - Child Commands

7. Can I export access to folio

8. data environment child command and SQL stored procedure

9. Need Help: Data Environment Child Command

10. ADO Data Environment Child Command refreshing problem

11. problem with child command in data environment designer

12. What are children commands for in Data Environments ?