不报错,但没移动行,没msgbox(ia1+1)和msgbox(.Position + 1)结果弹出。
For ia1 As Integer = 0 To dt.Table.rows.count-1 Step 2
If ia1+1 < dt.Table.Rows.Count Then
For ia As Integer = 0 To drs2.Count - 1
Dim dr2a1 As DataRow = DataTables("比赛积分").SQLFind("[团体赛或个人赛] = '" & lx & "' And [棋赛名称] = '" & di1 & "' And [第几轮比赛] = '" & Cstr(Val(di2)-1) & "' And [分组] = '" & Str & " And ([编号] = '" & dt.Table.Rows(ia1)("编号") & "'or [姓名] = '" & dt.Table.Rows(ia1)("姓名") & "')")
If dr2a1 IsNot Nothing Then
Dim dr2a2 As DataRow = DataTables("比赛积分").SQLFind("[团体赛或个人赛] = '" & lx & "' And [棋赛名称] = '" & di1 & "' And [第几轮比赛] = '" & Cstr(Val(di2)-1) & "' And [分组] = '" & Str & "' And [排序] = " & dr2a1("排序") & " And ([编号] <> '" & dt.Table.Rows(ia1)("编号") & "'or [姓名] <> '" & dt.Table.Rows(ia1)("姓名") & "')")
msgbox(ia1+1)
If dr2a2 IsNot Nothing Then
With dt.Table
msgbox(.Position + 1)
.Rows(ia1+1).Move(.Position + 1)
End With
End If
End If
Next
End If
Next
dt.Table.Save()
[此贴子已经被作者于2022/1/5 15:28:50编辑过]