[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 212
  • Last Modified:

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).
0
iamlori
Asked:
iamlori
2 Solutions
 
LenaWoodCommented:
DoCmd.OpenForm "FrmName",,,"[Yard] = " & Null

That should work.

Lena
0
 
raopsnCommented:
Try this on Form Open event

Dim rs As DAO.Recordset
Set rs = Me.Recordset
rs.FindFirst "[Yard] Is Null"
0
 
hnasrCommented:
Private Sub Form_Open(Cancel As Integer)
    Dim rs As Recordset
    Set rs = Me.RecordsetClone
    rs.FindFirst "[Yards] IS NULL"
    Me.Bookmark = rs.Bookmark
    rs.Close
End Sub
0
 
GRayLCommented:
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.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now