以下一段代码运行过一段时间没问题,今天突然出现以下错误提示,经过排查是以下在删除空行的时候现的问题,但仔细看了很多遍代码,实在发现不了到底是哪出问题了?请老师帮忙看看
此主题相关图片如下:123.jpg

Dim dr As DataRow = DataTables("SPB_ProcessSpecLibrary").Find("ProcessCode = '" & e.DataRow("ProcessCode") & "'")
If e.DataRow("ProcessDescription") <> dr("ProcessDescription") Then
Dim Index As Integer
Index = Tables("MainSchedule.SPB_ProcessSchdule").FindRow(e.DataRow) '找出此行的基础信息是有为空的值
If Index > -1 Then '如果找到此行
Tables("MainSchedule.SPB_ProcessSchdule").Position = Index '将焦点定位到此行
End If
msgbox("当前表的第 " & index+1 & "行工艺描述与工艺库不符,可能有手误更改,请重新选择~")
e.Cancel = True '取消存盘
End If
With e.DataRow
If .IsNull("ProcessNo") And .IsNull("SamplePart") And .IsNull("ProcessTeam") And .IsNull("ProcessMachine") And .IsNull("Partname") And .IsNull("Method") And .IsNull("ProcessDescription") Then '如果办单号,客户,款号,尺码,颜色都为空,则自动认为是无办单,系统自动删除;
e.DataRow.Delete
Return
Else
msgbox(4)
If .IsNull("ProcessNo") Then
Dim Index As Integer
Index = Tables("MainSchedule.SPB_ProcessSchdule").FindRow(e.DataRow) '找出此行的基础信息是有为空的值
If Index > -1 Then '如果找到此行
Tables("MainSchedule.SPB_ProcessSchdule").Position = Index '将焦点定位到此行
End If
msgbox("【工艺序号】不能为空,保存失败")
e.Cancel = True '取消存盘
ElseIf .IsNull("SamplePart") Then
Dim Index As Integer
Index = Tables("MainSchedule.SPB_ProcessSchdule").FindRow(e.DataRow) '找出此行的基础信息是有为空的值
If Index > -1 Then '如果找到此行
Tables("MainSchedule.SPB_ProcessSchdule").Position = Index '将焦点定位到此行
End If
msgbox("【办房部位】不能为空,保存失败")
e.Cancel = True '取消存盘
ElseIf .IsNull("ProcessTeam") Then
Dim Index As Integer
Index = Tables("MainSchedule.SPB_ProcessSchdule").FindRow(e.DataRow) '找出此行的基础信息是有为空的值
If Index > -1 Then '如果找到此行
Tables("MainSchedule.SPB_ProcessSchdule").Position = Index '将焦点定位到此行
End If
msgbox("【工艺分配(办房/大货)】不能为空,保存失败")
e.Cancel = True '取消存盘
ElseIf .IsNull("ProcessMachine") Then
Dim Index As Integer
Index = Tables("MainSchedule.SPB_ProcessSchdule").FindRow(e.DataRow) '找出此行的基础信息是有为空的值
If Index > -1 Then '如果找到此行
Tables("MainSchedule.SPB_ProcessSchdule").Position = Index '将焦点定位到此行
End If
msgbox("【工艺操作设备】不能为空,保存失败")
e.Cancel = True '取消存盘
ElseIf .IsNull("ProcessName") Then
Dim Index As Integer
Index = Tables("MainSchedule.SPB_ProcessSchdule").FindRow(e.DataRow) '找出此行的基础信息是有为空的值
If Index > -1 Then '如果找到此行
Tables("MainSchedule.SPB_ProcessSchdule").Position = Index '将焦点定位到此行
End If
msgbox("【工艺名称】不能为空,保存失败")
e.Cancel = True '取消存盘
ElseIf .IsNull("processDescription") Then
Dim Index As Integer
Index = Tables("MainSchedule.SPB_ProcessSchdule").FindRow(e.DataRow) '找出此行的基础信息是有为空的值
If Index > -1 Then '如果找到此行
Tables("MainSchedule.SPB_ProcessSchdule").Position = Index '将焦点定位到此行
End If
msgbox("【操作要求】不能为空,保存失败")
e.Cancel = True '取消存盘
ElseIf .IsNull("ProcessCode") Then
Dim Index As Integer
Index = Tables("MainSchedule.SPB_ProcessSchdule").FindRow(e.DataRow) '找出此行的基础信息是有为空的值
If Index > -1 Then '如果找到此行
Tables("MainSchedule.SPB_ProcessSchdule").Position = Index '将焦点定位到此行
End If
msgbox("当前表的第 " & index+1 & "行工艺不是在工艺库里选择的工艺,请重新选择~")
e.Cancel = True '取消存盘
Else
Return
End If
End If
End With