lizzieborden
MIS
Having problems finding records in my access database. I can add but no find. I want to be able to put in a word contained in some part of the Description field and be able to find a record. Part of the code works, if I put nothing in then I get error "Insufficient Text".
Dim sql As String
sql = "select * from Issues "
sql += " Where Description = '" & txtfind.Text & "' "
daIssues.SelectCommand.CommandText = sql
DsIssues1.Clear()
daIssues.Fill(DsIssues1)
If txtfind.Text = Nothing Then
MessageBox.Show("Insufficient Text")
'show all records
sql = "select * from Issues "
daIssues.SelectCommand.CommandText = sql
DsIssues1.Clear()
daIssues.Fill(DsIssues1)
End If
End Sub
Dim sql As String
sql = "select * from Issues "
sql += " Where Description = '" & txtfind.Text & "' "
daIssues.SelectCommand.CommandText = sql
DsIssues1.Clear()
daIssues.Fill(DsIssues1)
If txtfind.Text = Nothing Then
MessageBox.Show("Insufficient Text")
'show all records
sql = "select * from Issues "
daIssues.SelectCommand.CommandText = sql
DsIssues1.Clear()
daIssues.Fill(DsIssues1)
End If
End Sub