For Each r As Row In Tables("钣金开料单").rows
If r("顺序号") = 1 Then
r("piao号3") = r("piao号2")
Else
Dim dr As DataRow
Dim s1 As String = r("顺序号") - 1
MsgBox(s1)
dr = DataTables("钣金开料单").Find("piao号1 = '" & r("piao号1") & "' and 开料长度 = '" & r("开料长度") & "' and 冲孔程序 = '" & r("冲孔程序") & "' and 顺序号 = '" & s1 & "'")
If dr Is Nothing Then
MsgBox("找到了")
r("piao号3") = dr("piao号3")
Else
MsgBox("未找到")
r("piao号3") = dr("piao号2")
End If
End If
Next
上述按钮代码目的是查询上一行(s1)与本行的 “piao号1”、“开料长度” 和 “冲孔程序” 是否完全相同。但是测试结果,MsgBox 总是显示 "未找到"。请问哪里存在问题呢?谢谢。