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
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