On Error Goto ErrHandle
With Me.Adodc1.Recordset
If .EditMode <> adEditNone Then
If .EditMode = adEditAdd Then
bMoveLast = True
Else
bMoveLast = False
End If
End If
.Update***************运行到此句时错误产生
If bMoveLast Then
.MoveLast
Me.Toolbar1.Buttons("新增").Visible = True
Me.Toolbar1.Buttons("编辑").Enabled = True
Else
.Move 0
Me.Toolbar1.Buttons("编辑").Visible = True
Me.Toolbar1.Buttons("新增").Enabled = True
End If
End With
代码如下:
Dim bMoveLast As Boolean
With Me.Adodc1.Recordset
If .EditMode <> adEditNone Then
If .EditMode = adEditAdd Then
bMoveLast = True
Else
bMoveLast = False
End If
End If
.Update***************运行到此句时错误产生
If bMoveLast Then
.MoveLast
Me.Toolbar1.Buttons("新增").Visible = True
Me.Toolbar1.Buttons("编辑").Enabled = True
Else
.Move 0
Me.Toolbar1.Buttons("编辑").Visible = True
Me.Toolbar1.Buttons("新增").Enabled = True
End If
End With
问题是不管在此段程序中设置错误捕捉,还是在ADODC的willchangrecord中设置都无法更改错误显示信息。