代码如下,点击删除按钮时出现,索引超出范围。必须为非负值并小于集合大小。
If Tables("员工基础信息表.员工奖惩记录表").Rows.Count = 0 Then
MessageBox.show("当前员工没有奖惩记录!")
Else
Dim st As DialogResult
st = MessageBox.Show("确定要删除吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
If st = DialogResult.Yes Then
With Tables("员工基础信息表.员工奖惩记录表")
If .Current IsNot Nothing Then
.Current.Locked = False
.Current.delete
End If
End With
End If
End If