Dim sSql As String = " SELECT tbltrcclient.ClientID, tbltrcclient.Lastname,
tbltrcclient.Firstname, tbltrcclient.Barangay, tbltrcclient.TypeofSeed,
tbltrcclient.TypeofArea, tbltrcclient.Hectares FROM tbltrcclient WHERE
tbltrcclient.Firstname <' '
AND tbltrcclient.Lastname LIKE " & Quote(TextBox2.Text) _
OR tbltrcclient.Firstname LIKE " & Quote(TextBox3.Text) _
OR tbltrcclient.Barangay = " & Quote(ComboBox6.Text) _
OR tbltrcclient.TypeofSeed = " & Quote(ComboBox1.Text)
If (ComboBox3.Text <" ") Then
sSql &= " and tbltrcclient.TypeofArea = " & Quote(ComboBox3.Text)
End If
If (ComboBox2.Text <" ") Then
sSql &= " and tbltrcclient.TypeofArea = " & Quote(ComboBox2.Text)
End If
myd = .runQuery(sSql)
this is my search query where a user can search whether by lastname,
firstname, etc. i put a condition that the query won't include results that
has no firstname. when i run the program it still includes those with no
firstnames but it has no errors.
--
Message posted via DotNetMonster.com
http://www.dotnetmonster.com/Uwe/For...b-net/200804/1