Go to last 'null' record

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form listing people. On the form there is a start date and end date
[enddate]. The form is sorted such that first are the folks with null end
date, then everyone else.

I would like to add a button to quickly jump to the last 'current'
person/record.

Any suggestions would be appreciated.
 
The event procedure for the click event of your button will be something
like this:

Private Sub cmdGo_Click()
Dim rs As DAO.Recordset

If Me.Dirty Then 'Save any edits in progress.
Me.Dirty = False
End If

Set rs = Me.RecordsetClone
rs.FindLast "[enddate] is null"
If rs.NoMatch Then
MsgBox "Not found"
Else
Me.Bookmark = rs.Bookmark
End If
Set rs = Nothing
End Sub
 
Back
Top