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

What is wrong ?

Status
Not open for further replies.

groner

Programmer
May 18, 2002
23
RO
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<>&quot;&quot; And Combo2.Text=&quot;&quot; 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

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top