Microsoft Access 运行时错误 DoCmd.GoToRecord , , acNext
Microsoft Access runtime error DoCmd.GoToRecord , , acNext
为了方便用户,我一直在尝试在表单下方设置一组按钮。只有我遇到的脚本问题是我无法让下一个记录按钮工作。在这里我得到一个运行时错误 2105。
它应该做的是只显示下一条现有记录,但它会给出一个运行时错误并跳过所有其他记录并转到最后一条。
知道我做错了什么吗?
If Me.ActiveXBestEl92.Enabled = False Then
Me.ActiveXBestEl92.Enabled = True
End If
With Recordset
If .AbsolutePosition = .RecordCount Then
Me.ActiveXBestEl93.Enabled = False
Else
DoCmd.GoToRecord , , acNext
End If
End With
Exit_Next_Record:
Me.ActiveXBestEl93.Enabled = False
Exit Sub
Err_Next_Record:
MsgBox Err.Description
Resume Exit_Next_Record
提前致谢
试试这个:
With Me.RecordsetClone
If .AbsolutePosition = .RecordCount Then
Me!ActiveXBestEl93.Enabled = False
Else
.MoveNext
End If
End With
或者这个:
With Me.RecordsetClone
If Me.CurrentRecord = .RecordCount Then
Me!ActiveXBestEl93.Enabled = False
Else
.MoveNext
End If
End With
为了方便用户,我一直在尝试在表单下方设置一组按钮。只有我遇到的脚本问题是我无法让下一个记录按钮工作。在这里我得到一个运行时错误 2105。
它应该做的是只显示下一条现有记录,但它会给出一个运行时错误并跳过所有其他记录并转到最后一条。
知道我做错了什么吗?
If Me.ActiveXBestEl92.Enabled = False Then
Me.ActiveXBestEl92.Enabled = True
End If
With Recordset
If .AbsolutePosition = .RecordCount Then
Me.ActiveXBestEl93.Enabled = False
Else
DoCmd.GoToRecord , , acNext
End If
End With
Exit_Next_Record:
Me.ActiveXBestEl93.Enabled = False
Exit Sub
Err_Next_Record:
MsgBox Err.Description
Resume Exit_Next_Record
提前致谢
试试这个:
With Me.RecordsetClone
If .AbsolutePosition = .RecordCount Then
Me!ActiveXBestEl93.Enabled = False
Else
.MoveNext
End If
End With
或者这个:
With Me.RecordsetClone
If Me.CurrentRecord = .RecordCount Then
Me!ActiveXBestEl93.Enabled = False
Else
.MoveNext
End If
End With