I tried using the Rows.count property, however, once I click the search button, no results for any records will display. do i have the code in the wrong place?
Private Sub lnkFind_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lnkFind.Click
Dim strSearch As String
Dim strQuery As String
'Opens connection
cnNewClaim.Open()
'Get search
strSearch = txtClaimNUmber.Text
'Set up our SQL query text
strQuery = "SELECT [Claim Number], [City of Loss], [Claim Status], [Date Closed], [Date of Loss], Division, [Driver Hire Date], [First Name], INSCompany, [Insurance Claim Number], [Last Name], [License Number], [License State], [Location Code], MI, [Policy Number], Policy_ID, ReClosed, Reopen, [Report Date], [State of Loss], Subrogation, [Time of Loss], TPA, Tractor, Trailer1, TrailorType, [Type of Loss], [Unladen?], VIN FROM TblMasterClaimsRecord WHERE [Claim Number] LIKE '%" & strSearch & "%'"
'Make sure results are received
If DsNewClaim1.Tables("TblMasterClaimsRecord").Rows.Count > 0 Then
'Create the command object, passing in the SQL string
objCommand = New OleDb.OleDbCommand(strQuery, cnNewClaim)
daNewClaim.SelectCommand() = objCommand
'Populate dataset
daNewClaim.Fill(DsNewClaim1)
ddlInsured.DataBind()
ddlDivisions.DataBind()
ddlTrailorType.DataBind()
txtInsCo.DataBind()
txtPolicyID.DataBind()
txtPolicyNumber.DataBind()
txtClaimNUmber.DataBind()
ddlLossType.DataBind()
txtInsClaimNumber.DataBind()
ddlStatus.DataBind()
txtDateClosed.DataBind()
txtReopened.DataBind()
txtReClosed.DataBind()
txtReportDate.DataBind()
txtDateofLoss.DataBind()
txtTimeofLoss.DataBind()
txtCityofLoss.DataBind()
txtStofLoss.DataBind()
ddlLocationType.DataBind()
txtTractor.DataBind()
txtTrailor.DataBind()
txtVIN.DataBind()
ckbUnladen.DataBind()
ckbTPA.DataBind()
ckbSubro.DataBind()
txtLast.DataBind()
txtFirst.DataBind()
txtMiddle.DataBind()
txtLicNum.DataBind()
txtLicSt.DataBind()
txtStartDAte.DataBind()
'Close Connection
cnNewClaim.Close()
End If
End Sub