You could build the query like
Dim query As String = "select * from Incidents"
If txtDMA.Text <> "" Or txtStreet.Text <> "" Then
query &= " where "
If txtDMA.Text <> "" Then
query &= "DMA = '" & txtDMA.Text & "'"
End If
If txtStreet.Text <> "" Then
If txtDMA.Text <> "" Then
query &= " AND"
End If
query &= " StreetName LIKE '%" & txtStreet.Text & "%'"
End If
End If
Reverend Jim
Posting Shark
1,167 posts since Aug 2010
Reputation Points: 253
Solved Threads: 159