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!

Passing SQL Statements to a Data Report w/ groupings

Status
Not open for further replies.

mdmartin1

Technical User
Jan 7, 2002
4
US
Hello, I am trying to create a Data Report that will be generated from parameters received through input. I am using the Data Environment in VB6 and a Data Report. I have a db with one table and would like to receive user input to create an SQL statement to be passed to the Data Enviroment command. I am using the following command to pass the data.
Private Sub Command2_Click()
Dim sql As String, User As String
sql = "select * from main"
User = Text1.Text
sql = sql & " where user = '" & User & "'"
DataEnvironment1.Commands("Command1").CommandText = sql
DataReport1.Show
End Sub
This command works find until I add groupings to the Data Environment Command1. When I do this I get an invalid argument error when I run this code. I think I need additional code but am not sure what it would be. Any help would be appreicated.
Thank you
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top