子表datacolchanging事件
If e.DataCol.Name = "第一列" Then
Dim idx As Integer = Tables("关联表").FindRow(e.DataRow)
If idx > -1 Then
Dim r As Row
If idx Mod 2 = 0 Then
If idx <= Tables("关联表").rows.Count - 2 Then
r = Tables("关联表").rows(idx + 1)
End If
Else
If idx > 0 Then
r = Tables("关联表").rows(idx - 1)
End If
End If
If r IsNot Nothing Then
If e.NewValue = r("第一列") Then
MsgBox("不能相同")
e.Cancel = True
End If
End If
End If
End If