DataEnvironment.Commands(1).Parameters(0).Value=Combo1.Text
DataEnvironment.Commands(1).Parameters(1).Value=Combo2.Text
This code exist in Private Sub DataEnvironment_Initialeze{}
I put in DataEnvironment>Command1 this phrase in SQL Statment
"SELECT * FROM table WHERE name LIKE ? AND age LIKE ?"
If user not select something in Combo2 , I must change the SQL with IF-ELSE-END IF code like this :
Private Command1_Click()
If Combo1.Text="" Then Exit Sub
If Combo1.Text<>"" And Combo2.Text="" Then
DataEnvironment.Commands(1).Parameters(0).Value=Combo1.Text
Else
DataEnvironment.Commands(1).Parameters(0).Value=Combo1.Text
DataEnvironment.Commands(1).Parameters(1).Value=Combo2.Text
End If
End Sub
What is wrong in this code because in run time the program search 2 value (Combo1.Text and Combo2.Text)
Thanks for any sugestion
DataEnvironment.Commands(1).Parameters(1).Value=Combo2.Text
This code exist in Private Sub DataEnvironment_Initialeze{}
I put in DataEnvironment>Command1 this phrase in SQL Statment
"SELECT * FROM table WHERE name LIKE ? AND age LIKE ?"
If user not select something in Combo2 , I must change the SQL with IF-ELSE-END IF code like this :
Private Command1_Click()
If Combo1.Text="" Then Exit Sub
If Combo1.Text<>"" And Combo2.Text="" Then
DataEnvironment.Commands(1).Parameters(0).Value=Combo1.Text
Else
DataEnvironment.Commands(1).Parameters(0).Value=Combo1.Text
DataEnvironment.Commands(1).Parameters(1).Value=Combo2.Text
End If
End Sub
What is wrong in this code because in run time the program search 2 value (Combo1.Text and Combo2.Text)
Thanks for any sugestion