J
JB
This code is running in the Form_Load event of my mainform. It should
select the first subform record that is greater than or equal to
today's date. The subform is read only and all controls are locked.
lngCount gets set to 4 which is correct in my test example but the
record does not scoll into view inside the subform. The subform
contains five records and is large enough to view two at a time. This
code is an adapted sample so I am wondering if I am missing something?
Dim lngCount As Long
Dim rs As DAO.Recordset
Set rs = Me.frmReservationListDetail.Form.RecordsetClone
rs.MoveFirst
rs.FindFirst "[Loan_Date] >= Date()"
If rs.NoMatch Then
DoCmd.GoToRecord , , acLast
Else
lngCount = rs.AbsolutePosition
DoCmd.GoToRecord , , lngCount
End If
select the first subform record that is greater than or equal to
today's date. The subform is read only and all controls are locked.
lngCount gets set to 4 which is correct in my test example but the
record does not scoll into view inside the subform. The subform
contains five records and is large enough to view two at a time. This
code is an adapted sample so I am wondering if I am missing something?
Dim lngCount As Long
Dim rs As DAO.Recordset
Set rs = Me.frmReservationListDetail.Form.RecordsetClone
rs.MoveFirst
rs.FindFirst "[Loan_Date] >= Date()"
If rs.NoMatch Then
DoCmd.GoToRecord , , acLast
Else
lngCount = rs.AbsolutePosition
DoCmd.GoToRecord , , lngCount
End If