BrunoKP said:
I have tried this, but end up in the first record:
Private Sub Form_Load()
Dim rst As dao.Recordset
Dim dbsCurrent As Database
Set dbsCurrent = CurrentDb()
Set rst = Me.RecordsetClone
rst.MoveLast
rst.Close
dbsCurrent.Close
End Sub
I suppose that the recordset has not yet been displayed when Form_Load() is
activated. The question is, which event is the right one to use?
NOTE: You should never use Close on something you did not
Open!
When you use RecordsetClone, you have to sync the form's
current record to the RecordsetClone's current record:
With Me.RecordsetClone
.MoveLast
Me.Bookmark = .Bookmark
End With
OTOH, In A2000 and later, for the simple operation you want
to do here, there is no need to use RecordsetClone (and
possibly have to deal with an emptry recordset). It is
simpler to use:
Me.Recordset.MoveLast