Going to Last Record in Subform

  • Thread starter Thread starter Mark
  • Start date Start date
M

Mark

I have an Access 97 database. In it there is a form with a
subform. On the subform I have a button that opens up
another form in dialog box mode. When I close down the
dialog box form I want it to requery the subform and then
goto the last record on the subform. I have written code
in the dialog box form so that it successfully requeries
the subform.

Forms![frmApplicant]![fsubRebate].Form.Requery

However I can not figure out how to write code that puts
the focus on the subform and navigates to the last record.
How do I do this? Remember the code is in the separate
dialog box form not on the subform itself.

Thanks if you have an answer!

Mark
Ontario, Canada
 
This code will move to the last record in the subform. Unfortunately, it
will probably scroll all of the other records out the top of the subform.

Dim rs As DAO.Recordset
With Forms![frmApplicant]![fsubRebate].Form
.Requery
Set rs = .RecordsetClone
If rs.RecordCount > 0 Then
rs.MoveLast
.Bookmark = rs.Bookmark
End If
Set rs = Nothing
End With
 
Back
Top