R
richardlegare
I want to change the recordsource for every subreport before printing
it but I can't figure out How.
I have a report to which I set the recordsource by creating a
temporary table. The field in this table are DateStart and DateEnd and
Name. For each record, I want to show a sub report and modified it's
record source to show record where the date is between DateStart and
DateEnd.
I was looking to set the subreport recordsource with Report_Open() or
something like that but it only changes for the first record.
Here's mycode on the subreport:
Private Sub Report_Open(Cancel As Integer)
Report.RecordSource = "SELECT DISTINCT PersonnelHeure.NoProjet,
PersonnelHeure.Discipline, PersonnelHeure.Activite FROM PersonnelHeure
WHERE (((PersonnelHeure.Noms)='" & Parent.Noms & "') AND
((PersonnelHeure.Date) Between #" & Parent.DateStart & "# And #" &
Parent.DateEnd & "#)) ORDER BY PersonnelHeure.NoProjet;"
End Sub
Any ideas how to do this
it but I can't figure out How.
I have a report to which I set the recordsource by creating a
temporary table. The field in this table are DateStart and DateEnd and
Name. For each record, I want to show a sub report and modified it's
record source to show record where the date is between DateStart and
DateEnd.
I was looking to set the subreport recordsource with Report_Open() or
something like that but it only changes for the first record.
Here's mycode on the subreport:
Private Sub Report_Open(Cancel As Integer)
Report.RecordSource = "SELECT DISTINCT PersonnelHeure.NoProjet,
PersonnelHeure.Discipline, PersonnelHeure.Activite FROM PersonnelHeure
WHERE (((PersonnelHeure.Noms)='" & Parent.Noms & "') AND
((PersonnelHeure.Date) Between #" & Parent.DateStart & "# And #" &
Parent.DateEnd & "#)) ORDER BY PersonnelHeure.NoProjet;"
End Sub
Any ideas how to do this