There were two bugs in the code I gave you at first in post #4 (I warned you it was untested ), I corrected them in the attached db in post #8. Try the code below instead as it appears to work as you requested.
*Note that this function will return Null if doesn't find at least 2 or more whelping dates. If it only finds 1 whelping date and you do want to return that date anyway then change rs.RecordCount > 1 to rs.RecordCount > 0
Code:Private Function LookupPrevWhelpingDate(MotherID As Long) On Error GoTo ErrHandler Dim db As DAO.Database Dim rs As DAO.Recordset Dim qry As String Dim rslt As Variant qry = "SELECT TOP 2 WhelpingDate FROM ReproductionT WHERE MotherID = " & MotherID & " ORDER BY WhelpingDate DESC;" Set db = CurrentDb Set rs = db.OpenRecordset(qry) If Not (rs.BOF And rs.EOF) Then rs.MoveLast If rs.RecordCount > 1 Then rslt = rs!WhelpingDate End If End If ExitHandler: Set rs = Nothing Set db = Nothing LookupPrevWhelpingDate = rslt Exit Function ErrHandler: MsgBox Err.Description, , "Error #" & Err.Number Resume ExitHandler End Function