Jump to record

  • Thread starter Thread starter Harvard
  • Start date Start date
H

Harvard

I have a table named tblData, and i have a form based off of that table. I
want the form to open up to the last record of tblData, is there a way to do
this? I've tried using macros to get the job done, but i can't figure it out.

Any help would be appreciated.
 
The easiest way would be to build a query based on the table and sort it on
a date field or incrementing autonumber in descending order then base your
form on the query. All you need do is to build the query and change the
recordsource of the form.
 
This is adapted from the Access wizard code for this purpose.



Private Sub cboFindSiteNumber_AfterUpdate()
On Resume Next

Dim objRs As Object

If Not Me.Recordset Is Nothing Then
Set objRs = Me.Recordset.Clone
objRs.FindFirst "[SiteID] = " & Nz(Me![cboFindSiteNumber], 0)
If Not objRs.EOF Then Me.Bookmark = objRs.Bookmark
End If


End Sub
 
Back
Top