i have created a program that when a user types data , it will search for it, when the user searches for it, i want to make it so the user can add the item and remove the item if they wanted to.
my coding so far is
Private Sub cmdSearch_Click ()
If opt1 Then
Data1.RecordSou rce = "SELECT * FROM [Table] WHERE [Reference]='" & CStr(txtSearch. Text) & "'"
Data1.Refresh
End If
If opt2 Then
Data1.RecordSou rce = "SELECT * FROM [Table] WHERE [Item]='" & CStr(txtSearch. Text) & "'"
Data1.Refresh
End If
If opt3 Then
Data1.RecordSou rce = "SELECT * FROM [Table] WHERE [Item Description]='" & CStr(txtSearch. Text) & "'"
Data1.Refresh
End If
If opt4 Then
Data1.RecordSou rce = "SELECT * FROM [Table] WHERE [Quantity]='" & CStr(txtSearch. Text) & "'"
Data1.Refresh
End If
If opt5 Then
Data1.RecordSou rce = "SELECT * FROM [Table] WHERE [Price]='" & CStr(txtSearch. Text) & "'"
Data1.Refresh
End If
txtSearch.Text = ""
DBGrid1.Visible = True
End Sub
my coding so far is
Private Sub cmdSearch_Click ()
If opt1 Then
Data1.RecordSou rce = "SELECT * FROM [Table] WHERE [Reference]='" & CStr(txtSearch. Text) & "'"
Data1.Refresh
End If
If opt2 Then
Data1.RecordSou rce = "SELECT * FROM [Table] WHERE [Item]='" & CStr(txtSearch. Text) & "'"
Data1.Refresh
End If
If opt3 Then
Data1.RecordSou rce = "SELECT * FROM [Table] WHERE [Item Description]='" & CStr(txtSearch. Text) & "'"
Data1.Refresh
End If
If opt4 Then
Data1.RecordSou rce = "SELECT * FROM [Table] WHERE [Quantity]='" & CStr(txtSearch. Text) & "'"
Data1.Refresh
End If
If opt5 Then
Data1.RecordSou rce = "SELECT * FROM [Table] WHERE [Price]='" & CStr(txtSearch. Text) & "'"
Data1.Refresh
End If
txtSearch.Text = ""
DBGrid1.Visible = True
End Sub
Comment