如图:
此主题相关图片如下:360截图17571118108109120.png
![dvubb 图片点击可在新窗口打开查看](UploadFile/2018-11/201811301914735383.png)
筛选表中共24行,更改列("先后顺序")中的数字重新编号。我的思路:
列中数据更改后,将行移动到相应的位置后,通过列的相应位置重新生成新的编号。代码有问题,代码如下:
'''
If e.DataCol.Name = "先后顺序" Then
Dim c As Integer = 1
If e.DataRow.IsNull("检验项目") Then
MessageBox.Show("因无具体的检查项目无法进行先后排序,请予以补充!,","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Return
Else
Tables("检验资料维护").Filter = "[检验项目]='" & e.DataRow("检验项目") & "'"
With CurrentTable
Dim i As Integer = .Rows.Count
If e.NewValue Is Nothing Then
.Current.Move(i-1)
Else
.Current.Move(e.NewValue-1)
End If
End With
For Each r As Row In CurrentTable.Rows
r("先后顺序") = r.Index+1
Next
End If
End If