Forum Discussion
kvhmir
Feb 17, 2022Copper Contributor
Recordsetclone gives empty recordset
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
2 Replies
Sort By
- arnel_gpSteel Contributormaybe got to do with your OpenArgs, what is the value passed?
you need a Fieldname to filter it.
and I believe this is from the Load event of the subform?
strSplit = Split(Me.Parent.OpenArgs, "€€€€€")
Me.Filter = "theField = '" & strSplit & "'"
Me.FilterOn = True