Hi everyone..
i have added one textbox called discount to one of my form to display the discount if it exists and also to enter in the textbox... i have button called viewall which is in the FormUpdateSQL1... when i open the viewall window and click on the particular row and click on the buttion view selected on i m getting this error : Invalid use of Null.. i have changed everything which i knew.. i dont knw wht else i should do..
i m sending u the code.. the bold line is whr i m getting the error
wld u plz help me out here..
thank u very much
-
-
Private Sub cmbPoNo_Click()
-
Dim Rs As New ADODB.Recordset
-
If cmbPoNo.Text <> "" Then
-
txtPoYear.Text = ""
-
txtAmendno.Text = ""
-
txtPoAmount.Text = ""
-
txtpotax.Text = ""
-
txtUnitId.Text = ""
-
txtdiscount.Text = ""
-
If Rs.State = adStateOpen Then Rs.Close
-
Rs.Open ("select * from TxPoHdr Where PoNo = '" & cmbPoNo.Text & "'And Ind ='1' And yy = '" & FinancialYear & "' "), Db, adOpenKeyset, adLockPessimistic
-
If Not (Rs.BOF And Rs.EOF) Then
-
txtPoAmount.Text = Rs.Fields("PoAmt").Value
-
txtpotax.Text = Rs.Fields("PoTax").Value
-
txtAmendno.Text = Rs.Fields("AmendNo").Value
-
txtUnitId.Text = Rs.Fields("Unitid").Value
-
txtPoYear.Text = Rs.Fields("YY").Value
-
txtdiscount.Text = Rs.Fields("Discount").Value
-
End If
-
End If
-
-
If cmbPoNo.Text <> "" Then
-
Adodc2.ConnectionString = pStrConnectionString
-
Adodc2.RecordSource = " Select Bill.BillSrl,Bill.YY,Bill.PoNo,Bill.BillNo ,Bill.BillAmt,Bill.BillTax,convert(VarChar(20), Bill.BillDate, 6) As BillDate,Unit.UnitNm,Ven.VendorNm,Bill.Ind,Bill.discount from TxBills Bill, MsUnits Unit, MsVendors Ven Where Bill.UnitId = Unit.UnitId And Bill.VendorId = Ven.VendorId and Bill.YY = " & FinancialYear & " and Bill.PoNo = " & cmbPoNo.Text & " and Bill.VendorId = " & txtVendorId.Text & " order by Bill.BillSrl "
-
Adodc2.Refresh
-
MSHFlexGrid2.ColWidth(1) = 1000
-
MSHFlexGrid2.ColWidth(2) = 700
-
MSHFlexGrid2.ColWidth(3) = 700
-
MSHFlexGrid2.ColWidth(4) = 700
-
MSHFlexGrid2.ColWidth(5) = 1200
-
MSHFlexGrid2.ColWidth(6) = 1200
-
MSHFlexGrid2.ColWidth(7) = 1200
-
MSHFlexGrid2.ColWidth(8) = 2500
-
MSHFlexGrid2.ColWidth(9) = 1800
-
MSHFlexGrid2.ColWidth(10) = 400
-
MSHFlexGrid1.ColWidth(11) = 1000
-
MSHFlexGrid2.Refresh
-
End If
-
End Sub
-