I need help here...

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • squrel
    New Member
    • Jan 2008
    • 143

    I need help here...

    Hello everyone..

    I m having a problem over here and dont knw wht else i have to do...
    i have 2 listviews (LvBill and LvBillPo) the data from LvBill wil go to the LvBillPo and if its fine then it wil get saved by pressing on the save button and data wil get updated in a table called txpaypo.. bt when i m pressing on save button is giving me thie error "Multiple-Step operation generated errors. check each status value."
    i have checked everything bt still is not working.. can u help me plz... i wil send u the code.. i m getting error on the line which is bold
    thank u very much in advance




    If LvBillPo.ListIt ems.Count <> 0 Then
    Dim rsTxBills As New ADODB.Recordset
    Dim j As Integer
    'save data
    If rsTxBills.State = adStateOpen Then rsTxBills.Close
    rsTxBills.Open ("TxPayPo"), Db, adOpenKeyset, adLockPessimist ic
    For j = 1 To LvBillPo.ListIt ems.Count

    With rsTxBills
    rsTxBills.AddNe w
    .Fields("YY") = LvBillPo.ListIt ems(j).SubItems (1)
    .Fields("PaySrl ") = LvBillPo.ListIt ems(j).SubItems (2)
    .Fields("PoYY") = LvBillPo.ListIt ems(j).SubItems (1)
    .Fields("PoNo") = LvBillPo.ListIt ems(j).Text
    .Fields("AmendN o") = LvBillPo.ListIt ems(j).SubItems (3)
    .Fields("UnitId ") = LvBillPo.ListIt ems(j).SubItems (5)
    If IsNull(LvBillPo .ListItems(j).S ubItems(6)) = False Then .Fields("AdjAmt ") = LvBillPo.ListIt ems(j).SubItems (6)
    If IsNull(LvBillPo .ListItems(j).S ubItems(7)) = False Then .Fields("TDSAmt ") = LvBillPo.ListIt ems(j).SubItems (7)
    .Fields("BillSr l") = LvBillPo.ListIt ems(j).SubItems (8)
    '.Fields("BillN o") = LvBillPo.ListIt ems(j).SubItems (9)
    '.Fields("BillY Y") = LvBillPo.ListIt ems(j).SubItems (10)

    .Fields("EntryD ate") = Format(Date, "DD-MMM-YYYY")
    .Fields("EntryU ser") = Trim(pStrLoginN m)
    .Fields("EntryT ime") = Format(Time, "HH:MM")

    .Update
    End With

    Next j
    rsTxBills.Close
    End If
  • QVeen72
    Recognized Expert Top Contributor
    • Oct 2006
    • 1445

    #2
    Hi,

    That Error Appears if DataType from Database Table does not match with the Datatype on the form..

    I Guess, PONo in Database table is Numeric field,
    Change your code to :

    [code=vb]
    .Fields("PoNo") = Val(LvBillPo.Li stItems(j).Text )
    [/code]

    Also, make sure, LvBillPo.ListIt ems(j).Text is of same datatype as in Database table....
    You may get the error, if both are Texts
    and in Database you have Textsize=10
    and you are trying to save text more than 10 Chars..


    Regards
    Veena

    Comment

    • squrel
      New Member
      • Jan 2008
      • 143

      #3
      Thank u very much for ur reply... it wil work the way u told me to do bt then in database my pono is showing 0 (zero)... i have checked the database textsize and eveything is the same... any suggestion..
      thank u

      Comment

      • squrel
        New Member
        • Jan 2008
        • 143

        #4
        Got the answer... thank u very very much
        God BLess

        Comment

        Working...