Hi there,
I have a problem deleting records froma dataset. It works for some but not for all.
Could you help determine what the problem is please:
What it is supposed to do is delete the record from the dataset and either move back one record and if it can't move forward one. If there arent any more records call addnewrecord.
I do have 3 different screens for entering data into three different tables, but whenever i move screen the currentRow is always set to 0 and FillData is run with the current row as 0.
Thanks.
EDIT:
I think it only doesn't work once i have deleted one record.
I have a problem deleting records froma dataset. It works for some but not for all.
Could you help determine what the problem is please:
VB.NET:
Public Sub DeleteRecord(ByVal formObjects As List(Of Control), ByVal table As String, ByVal row As Integer, ByVal lastRow As Integer)
dataSet.Tables(table).Rows.RemoveAt(row)
lastRow -= 1
If dataSet.Tables(table).Rows.Count > 0 Then
If (row - 1) > 0 Or (row - 1) = 0 Then
currentRow = (row - 1)
Call FillData(formObjects, table, currentRow)
ElseIf row < lastRow Or row = lastRow Or row = 0 Then
currentRow = row
Call FillData(formObjects, table, currentRow)
End If
Else
Call AddNewRecord(formObjects)
addNew = True
End If
End Sub
What it is supposed to do is delete the record from the dataset and either move back one record and if it can't move forward one. If there arent any more records call addnewrecord.
I do have 3 different screens for entering data into three different tables, but whenever i move screen the currentRow is always set to 0 and FillData is run with the current row as 0.
Thanks.
EDIT:
I think it only doesn't work once i have deleted one record.
Last edited: