J
JB
I have this code on a main form in the Form_Load event. I am adapting
this from someone else's sample. I want the code to find and select
the first record in a continuous subform that is greater than or equal
to todays' date. Once it does that, I want the current selected record
to scroll up inside the subform to be the first record in view. I
think this is working properly to find the record but the record does
not scroll into view.
In one example, there are five records in the subform. The subform is
sized to show two records at a time. The fifth record has a date
greater than today's date. The lngCount variable gets set to 4. Is
there something else I need to do so the selected record scrolls into
view inside the subform?
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
this from someone else's sample. I want the code to find and select
the first record in a continuous subform that is greater than or equal
to todays' date. Once it does that, I want the current selected record
to scroll up inside the subform to be the first record in view. I
think this is working properly to find the record but the record does
not scroll into view.
In one example, there are five records in the subform. The subform is
sized to show two records at a time. The fifth record has a date
greater than today's date. The lngCount variable gets set to 4. Is
there something else I need to do so the selected record scrolls into
view inside the subform?
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