bomber_grrl
May 29th, 2003, 06:13 PM
When the user selects "Search All" from the combobox, the search should cycle through each of the datarows of the specified datatable for matching text entered by the user in a grouped text box. Unfortunately, I keep getting the error message: Cast from string "SELECT Description Like '%CRC%'" to type 'Long' is not valid.
Any ideas on why the code below isn't working?
If cbChooseCol.SelectedItem = ("[Select All]") Then
Dim field1, criterial As String
field1 = "PartMaster."
criterial = txtCriterial.Text
criterial.StartsWith("")
.Clear()
.DefaultView.RowFilter = _
"SELECT Description Like '%" & txtCriterial.Text & "%'" Or _
"Cytopeia PN Like '%" & txtCriterial.Text & "%'" Or _
"[Foot Print] Like '%" & txtCriterial.Text & "%'" Or _
"Manufacturer Like '%" & txtCriterial.Text & "%'" Or _
"[Manufacturer PN] Like '%" & txtCriterial.Text & "%'" Or _
"Vendor Like '%" & txtCriterial.Text & "%'" Or _
"[Vendor] like '%" & txtCriterial.Text & "%'" Or _
"Notes like '%" & txtCriterial.Text & "%'" Or _
"Prefix like '%" & txtCriterial.Text & "%'" Or _
"from PartMaster WHERE ," & _
"(" & field1 & " = '" & criterial & " ')"
:rolleyes:
Any ideas on why the code below isn't working?
If cbChooseCol.SelectedItem = ("[Select All]") Then
Dim field1, criterial As String
field1 = "PartMaster."
criterial = txtCriterial.Text
criterial.StartsWith("")
.Clear()
.DefaultView.RowFilter = _
"SELECT Description Like '%" & txtCriterial.Text & "%'" Or _
"Cytopeia PN Like '%" & txtCriterial.Text & "%'" Or _
"[Foot Print] Like '%" & txtCriterial.Text & "%'" Or _
"Manufacturer Like '%" & txtCriterial.Text & "%'" Or _
"[Manufacturer PN] Like '%" & txtCriterial.Text & "%'" Or _
"Vendor Like '%" & txtCriterial.Text & "%'" Or _
"[Vendor] like '%" & txtCriterial.Text & "%'" Or _
"Notes like '%" & txtCriterial.Text & "%'" Or _
"Prefix like '%" & txtCriterial.Text & "%'" Or _
"from PartMaster WHERE ," & _
"(" & field1 & " = '" & criterial & " ')"
:rolleyes: