25 pts.
 Getting error in this VB 6 code
Sr No Crop Varity Psize Pkts 1 Fodder NG-1788 1 kg 180 2 Sf SN-85 2 Kg 100 3 Beet B-885 1 kg 100 4 Beet B-885 1 kg 150 5 Beet B-885 1 kg 200 6 Beet B-885 1 kg 250 7 Beet B-885 1 kg 300 8 Beet B-885 1 kg 350 9 Beet B-885 1 kg 400 10 Beet B-885 1 kg 500 New Modify Delete Close View I have above datadgrid base in VB6, when modify Sr No 1 and save, but when I view again it has been change Sr No 10 this was happen only when the same data serialy OR maximum data I give a short coading for your reference please help me immediately Thanking you Krrish Private Sub cmdDetAdd_Click() DetRecordStatus = RecNew mDetailStatus = DetailNew Call ClearDetails Call SetDetButtonStatus If HdrRecordStatus <> RecNew Then txtIndentRefNo.Enabled = False cmdIndentRefNo.Enabled = False Else txtIndentRefNo.Enabled = True cmdIndentRefNo.Enabled = True txtIndentRefNo.SetFocus End If If Len(Trim(txtCrop.Text)) = 0 Then txtIndentRefNo.SetFocus Else 'txtLotNo.SetFocus End If End Sub Private Sub cmdDetModify_Click() If HdrRecordStatus = RecNew Or HdrRecordStatus = RecModify Then DetRecordStatus = RecModify Call AddDetailsToControls GridRow = flxDetail.Row Call SetDetButtonStatus 'txtNoOfBags.SetFocus txtVariety.SetFocus End If End Sub Private Sub cmdDetDelete_Click() On Error GoTo ErrHandler Dim strQry As String Dim RowCnt As Integer Dim IsBeginTrans As Boolean IsBeginTrans = False With flxDetail If .Rows > 1 Then GridRow = .Row If GridRow = 0 Then Exit Sub Call AddDetailsToControls If MsgBox("Do you want to delete the Marketing seed despatch detail of lot number " & Chr(13) & _ .TextMatrix(GridRow, SOLotNoCol), vbYesNo) = vbNo Then Exit Sub If .TextMatrix(GridRow, SOStatusCol) = DetailExisting Then If Len(Trim(.TextMatrix(GridRow, SOInvisibleLotNo))) > 0 Then strQry = "Delete from MktDespatchDet " & _ " Where MktDespatchRefNo = '" & Trim(txtDespatchRefNo.Text) & "'" & _ " and MktLotNo = '" & Trim(.TextMatrix(GridRow, SOInvisibleLotNo)) & "'" gNSLConn.BeginTrans IsBeginTrans = True gNSLConn.Execute strQry strQry = "Update MktLotMst set " & _ " NoOfBags = NoOfBags + " & Val(.TextMatrix(GridRow, SONoOfBagsCol)) & _ ", IsExists = 'Y' " & _ " Where LotNo = '" & Trim(.TextMatrix(GridRow, SOInvisibleLotNo)) & "'" gNSLConn.Execute strQry gNSLConn.CommitTrans IsBeginTrans = False End If End If If DeleteMSFGRow(flxDetail) = False Then MsgBox "Error in Flexgrid Row Deletion" GoTo ErrHandler End If Call cmdDetClear_Click End If End With Exit Sub ErrHandler: If IsBeginTrans = True Then gNSLConn.RollbackTrans End If Call ErrorLog(Err.Number, Err.Description, Err.Source, Me.Name, "cmdDetDelete_Click") End Sub

Software/Hardware used:
ASKED: June 3, 2009  11:26 AM
UPDATED: June 3, 2009  12:09 PM

Answer Wiki:
Last Wiki Answer Submitted:  Be the first to answer this question.
All Answer Wiki Contributors:  Be the first to answer this question.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _