Goto first Null Record

I have a table that lists all the days of the year with fields: Date and Yards.  The idea is to enter a number of yards for each day of the year.
I have a form (in datasheet view) that allows the user to enter the number of yards for each date.  Right now - when the form/datasheet opens - it goes automatically to 1/1/2006 (because that is the first record of the table).  What function/event can I use so that the form will open and find the first null value in the Yards field?  (avoiding the scrolling to the next empty record).
Who is Participating?
DoCmd.OpenForm "FrmName",,,"[Yard] = " & Null

That should work.

Try this on Form Open event

Dim rs As DAO.Recordset
Set rs = Me.Recordset
rs.FindFirst "[Yard] Is Null"
Private Sub Form_Open(Cancel As Integer)
    Dim rs As Recordset
    Set rs = Me.RecordsetClone
    rs.FindFirst "[Yards] IS NULL"
    Me.Bookmark = rs.Bookmark
End Sub
Remember, Date is an Access function and should never be used as a table, field, or variable name.  If you absolutely have to, remember is must always be surrrounded by brackets when you make reference to it in a query or a module.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.