R
Richard
i have created a recordset based on the records of a subform. It will loop
the records to get some information. It works when I tried it. But when I
save the form and open it again, click on the command to loop through the
subform, it runs as if there are no records (at debugging) even when the
subform shows there are records.
I go into design mode of the form, view the form again, tried the command
and it works. Close the form, open it normal - stop working again... Does it
need to be refreshed in some way? How do I overcome this issue?
Many thanks in advance
RIchard
part of the code:
Dim cnn As ADODB.Connection
Dim rs As Recordset
Dim strsql As String
Set cnn = CurrentProject.Connection
Set rs = Me.SubForm.Form.RecordsetClone
With rs
If Not (.EOF And .BOF) Then
'do someting
the records to get some information. It works when I tried it. But when I
save the form and open it again, click on the command to loop through the
subform, it runs as if there are no records (at debugging) even when the
subform shows there are records.
I go into design mode of the form, view the form again, tried the command
and it works. Close the form, open it normal - stop working again... Does it
need to be refreshed in some way? How do I overcome this issue?
Many thanks in advance
RIchard
part of the code:
Dim cnn As ADODB.Connection
Dim rs As Recordset
Dim strsql As String
Set cnn = CurrentProject.Connection
Set rs = Me.SubForm.Form.RecordsetClone
With rs
If Not (.EOF And .BOF) Then
'do someting