1.表格没有“员工姓名”这列
2.判断放到最前面
If e.Table.Current Is Nothing Then '如果Current为Nothing
Return '则返回
End If
If Forms("窗口1").Opened Then
If e.Table.Name = "表B" Then
Dim pd,cs As String
pd=e.Table.Current("第七列")
cs=e.Table.Current("第一列")
Dim si As Integer
si = Tables("表A").FindRow("[第二列] ='" & pd & "'",0,True)
If si >= 0 Then
Tables("表A").Position = si
End If
si = Tables("表B").FindRow("[第七列] ='" & cs & "'",0,True)
If si >= 0 Then
Tables("表B").Position = si
End If
End If
If e.Table.Current Is Nothing Then '如果Current为Nothing
Return '则返回
End If
End If
Dim dr As DataRow = DataTables("表A").Find("[_Identify] = " & e.Table.Current("第三列"))
Dim idx As Integer = Tables("表A").FindRow( dr)
If idx > - 1 Then '如果找到符合条件的行
Tables("表A").Position = idx '则选择该行
End If