老师:您好!下面是我编写的一段代码,在输入第一组数据后,成绩表中成绩1列的其他人的相关内容出现0。怎样做才能使其他行的起始数据没有任何内容呢?
Dim kgt1,kgt2,zgt1,zgt2 As Integer
For Each dr As DataRow In DataTables("答题数据1").datarows
Dim fdr1 As DataRow = DataTables("客观题答案").find("客观题1 = '" & dr("客观题1") & "' And 试卷号 = '" & DataTables("答题数据1").name & "'")
Dim fdr2 As DataRow = DataTables("客观题答案").find("客观题2 = '" & dr("客观题2") & "' And 试卷号 = '" & DataTables("答题数据1").name & "'")
Dim ndr As DataRow = DataTables("成绩表").Find("学号 = '" & dr("学号") & "'")
If ndr Is Nothing Then
ndr = DataTables("成绩表").AddNew
ndr("学号") = dr("学号")
End If
If fdr1 Is Nothing Then
kgt1 = 0
Else
kgt1= 1
End If
If fdr2 Is Nothing Then
kgt2 = 0
Else
kgt2= 1
End If
If dr("主观题1") = "t" Then
zgt1 = 1
Else
zgt1=0
End If
If dr("主观题2") = "t" Then
zgt2 = 1
Else
zgt2=0
End If '给相关列赋值
ndr("成绩1") = kgt1 + kgt2 + zgt1+ zgt2
Next