I'm new to programming and got stuck with an issue and was wondering if you could lend a hand. I have an Access database I'm building a front end for in VB 2010, I was able to connect to the database to retrieve records. I built a search feature and was able to find records with it, but I have searched and searched the web and can't find the right way to accomplish my goal. On the search I need to only search records that are marked "Active" as per the "Active" checkbox, I have tried all possible combinations and I cannot get it to work, here is my code:
I have a textbox, txtAssetTagSear ch to put the search string and a search button. He above code works fine, but I need to somehow add the respective code so that it only searches records whose "Active.che cked = True" checkbox and if not found, to return record not found.
ANY help would be GREATLY appreciated, THANKS in advance!
Code:
Dim searchString As String = txtAssetTagSearch.Text Dim dataRow() As DataRow = AMSDataSet.tblITEquipment.Select("AssetTag like '%" & searchString & "%'", "AssetTag") If dataRow.GetUpperBound(0) >= 0 Then Dim index As Integer index = TblITEquipmentBindingSource.Find("AssetTag", dataRow(0).Item("AssetTag").ToString) TblITEquipmentBindingSource.Position = index Else MsgBox("Record NOT Found!", MsgBoxStyle.Exclamation, "Asset Tag Search") txtAssetTagSearch.Text = "" End If
ANY help would be GREATLY appreciated, THANKS in advance!
Comment