Log in

View Full Version : [SLEEPER:] Report all records from subform



Ignigo
10-27-2019, 01:08 AM
Good Morning;

I have a problem associated with a multi instance report associated with a form subform.

It works perfectly for me, but it only shows me the first record of the subform where there are more than one register.

I imagine is the focused register.

The subform is in continuous mode.

The code is:


Private Sub FichaTecnicaParte_Click()
Dim rptFicha As Report
Static intCtr As Integer
intCtr = intCtr + 1
Set rptFicha = New Report_Ficha_Tecnica_General
With rptFicha
.Visible = True
'.Caption = frmCalReb.Hwnd & ", opened " & Now() '"L1 Rebob." '
.Filter = "[Artículo] = '" & Me!FABRICACION!Artículo & "'"
.FilterOn = True
.Move 0, intCtr * 500
End With
'Append it to our collection.
clnClient.Add Item:=rptFicha, key:=CStr(rptFicha.Hwnd)
Set rptFicha = Nothing
End Sub

Can someone help me show all the records in the report?

Thank you.

Regards,

OBP
10-27-2019, 01:55 AM
You appear to be setting the Report filter to the Subform's "Articulo" rather than the Mainform's Articulo, which should be the Form's Master link in the Master/Child link.

I do not set report filters I use queries to set the report's recordset, as that is what they are for.