Dim sSql As String = " SELECT tbltrcclient.Cl ientID, tbltrcclient.La stname,
tbltrcclient.Fi rstname, tbltrcclient.Ba rangay, tbltrcclient.Ty peofSeed,
tbltrcclient.Ty peofArea, tbltrcclient.He ctares FROM tbltrcclient WHERE
tbltrcclient.Fi rstname <' '
AND tbltrcclient.La stname LIKE " & Quote(TextBox2. Text) _
OR tbltrcclient.Fi rstname LIKE " & Quote(TextBox3. Text) _
OR tbltrcclient.Ba rangay = " & Quote(ComboBox6 .Text) _
OR tbltrcclient.Ty peofSeed = " & Quote(ComboBox1 .Text)
If (ComboBox3.Text <" ") Then
sSql &= " and tbltrcclient.Ty peofArea = " & Quote(ComboBox3 .Text)
End If
If (ComboBox2.Text <" ") Then
sSql &= " and tbltrcclient.Ty peofArea = " & 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.c om
tbltrcclient.Fi rstname, tbltrcclient.Ba rangay, tbltrcclient.Ty peofSeed,
tbltrcclient.Ty peofArea, tbltrcclient.He ctares FROM tbltrcclient WHERE
tbltrcclient.Fi rstname <' '
AND tbltrcclient.La stname LIKE " & Quote(TextBox2. Text) _
OR tbltrcclient.Fi rstname LIKE " & Quote(TextBox3. Text) _
OR tbltrcclient.Ba rangay = " & Quote(ComboBox6 .Text) _
OR tbltrcclient.Ty peofSeed = " & Quote(ComboBox1 .Text)
If (ComboBox3.Text <" ") Then
sSql &= " and tbltrcclient.Ty peofArea = " & Quote(ComboBox3 .Text)
End If
If (ComboBox2.Text <" ") Then
sSql &= " and tbltrcclient.Ty peofArea = " & 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.c om
Comment