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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Data environment: child-command problem

Status
Not open for further replies.

VBmim

Programmer
Jun 25, 2001
361
BE
I have set up a Data report with Data environment to work with an Access 2000 database. When I set up a command and a child-command at design-time it works fine, but when I want to set the sql-statements at run-time I get an "Invalid procedure call or argument" fault.

This is the code for the child-command:
DataEnvironment1.Commands("Dataquery").CommandText = "select * from " & Tabelnaam & " order by sgroep"

The code for the command is
DataEnvironment1.Commands("groep").CommandText = "Select distinct groep from " & Tabelnaam

Tabelnaam is a variable I use (I have to work with 6 different tables).

Can anyone help me?

greetings

Mim

 
Found solution on my own...

This was what I had to do:
DataEnvironment1.Commands("groep").CommandText = "SHAPE {select distinct groep from " & Tabelnaam & " } APPEND ({select * from " & Tabelnaam & " order by sgroep} as dataquery RELATE groep TO groep)"

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top