If rs.State = 1 Then rs.Close
rs.Open "Select CM.Cash_MemoNo AS CM_No, CM.CM_Date as CM_Date, BD.BDate as BDate,BD.From_City as Bkg_Off, CM.LRNo, BD.Article as Art, BD.Weight, BD.TotToPay as Topay, TotPaid as Paid, CM.Acc_Typ AS Acc, CM.CNee, CM.Octroi, CM.Demerage as Dem, CM.Hamali as Labour, CM.DDCharge as D_Del, CM.OctSC, CM.InsuCharge as R_Charge, CM.ServiceTax as STax, CM.CM_Total as Total FROM CashMemo AS CM, Bilty_Detail as BD where CM.CM_Date between CDATE('" & DTPickerFrom.Value & "') and CDATE('" & DTPickerTo.Value & "') and BD.BiltyNo = CM.LRNo Order by CM.Cash_MemoNo", con, adOpenKeyset, adLockOptimistic
' rs.Open "Select CM.Cash_MemoNo AS CM_No, CM.CM_Date as CM_Date, BD.BDate as BDate,BD.From_City as Bkg_Off, CM.LRNo, BD.Article as Art, BD.Weight, BD.TotToPay as Topay, TotPaid as Paid, CM.Acc_Typ AS Acc, CM.CNee, CM.Octroi, CM.Demerage as Dem, CM.Hamali as Labour, CM.DDCharge as D_Del, CM.OctSC, CM.InsuCharge as R_Charge, CM.ServiceTax as STax, CM.CM_Total as Total, BD.TotToPay as TTbb FROM CashMemo AS CM, Bilty_Detail as BD where CM.CM_Date between CDATE('" & DTPickerFrom.Value & "') and CDATE('" & DTPickerTo.Value & "') and BD.BiltyNo = CM.LRNo and BD.Pymt_mode = 'TBB' Order by CM.Cash_MemoNo", con, adOpenKeyset, adLockOptimistic
If rs.RecordCount > 0 Then
Set DataGrid1.DataSource = rs
End If
End If
End If
Join the community of 500,000 technology professionals and ask your questions.
Connect with top rated Experts
11 Experts available now in Live!