Feb 17 2022 04:01 AM - edited Feb 17 2022 04:02 AM
I have code below which is in the Form-Load. According help, the Form-Load-event is triggered after the records have been loaded. However, the Set rs = Me.Recordset retrieves no records at all. I also tried with Set rs = Me.Recordsetclone
If I go in debug mode through the code, line 16 is skipped.
However, the form does show the expected records.
So why is my RS-recordset empty?
Private Sub Form_Load()
Dim strSplit() As String
Dim rs As Recordset
Dim intInSpec As Integer
If Not IsNull(Parent.OpenArgs) Then
strSplit = Split(Parent.OpenArgs, "€€€€€")
Me.Filter = strSplit(1)
Me.FilterOn = True
End If
Me.Form.Section(2).Visible = False
intInSpec = 0
Set rs = Me.Recordset
While Not rs.BOF And Not rs.EOF
rs.MoveNext
Wend
End Sub
Feb 17 2022 04:20 AM
Feb 17 2022 05:26 AM
It's not related with the arguments. The filter works as expected and the expected records are shown.
It's indeed true the code is in the subform.