为什么不在记录集的MoveComplete中做呢
Private Sub rsCommand1_MoveComplete(ByVal adReason As ADODB.EventReasonEnum, ByVal pError As ADODB.Error, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset)
If rsCommand1.EOF Then
MsgBox "Last Record"
If Not rsCommand1.BOF Then
rsCommand1.MovePrevious
End If
End If
End Sub
You can not judge in the command_click event.
You must write code to judge in the rscordset_MoveComplete event
Private Sub rsCommand1_MoveComplete(ByVal adReason As ADODB.EventReasonEnum, ByVal pError As ADODB.Error, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset)
If rsCommand1.EOF Then
MsgBox "Last Record"
If Not rsCommand1.BOF Then
rsCommand1.MovePrevious
End If
End If
End Sub
when you bind recordset to your controls dynamicly, modify your recordset declaration code.