If User.Group = "行政" Or User.name = "开发者"
If CurrentTable.name.contains("模具保养")
For Each r As Row In Tables("生产模数统计").rows
' Dim NY As String = r("年") & r("月")
' If NY.length = 5
' NY = r("年") & "0" & r("月")
' Else
' NY = r("年") & r("月")
' End If
If r("模具型号") = ""
Else
Dim contains As Boolean = False
For Each dr As DataRow In DataTables("模具保养").DataRows
' If dr("年月") = NY
If dr("模具型号") = r("模具型号")
dr("本月生产") = r("生产模数")
contains = True
Exit For
End If
' End If
Next
If contains = False Then
Dim dr1 As DataRow
dr1 = DataTables("模具保养").AddNew()
dr1("模具型号") = r("模具型号")
dr1("本月生产") = r("生产模数")
End If
End If
Next
End If
End If
如上代码在原来的目的是:在“模具保养”里面查找日期和和模具型号都相同的数据行,然后将“生产模数统计”里面的“生产模数”插入到“模具保养”里面的“本月生产”里面去,后来我不需要比较日期是否相同了,就把与日期有关的代码注释掉了,但是整段代码却不起作用了。请教是哪里的问题?