Getting error in this VB 6 code

25 pts.
Tags:
DataGrid
Visual Basic 6
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

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Krrish
    [...] Here is the original: Getting error in this VB 6 code [...]
    0 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following