Dynamically Change Recordsource of a Subreport

TheSearcher

Registered User.
Local time
Today, 14:55
Joined
Jul 21, 2011
Messages
406
If txt_Sex on Main Report = "M" then I want the recordsource of Subreport1 to be q_Male else q_Female.

Code:
If Parent!txt_Sex = "M" Then
    Me.RecordSource = q_Male
Else
    Me.RecordSource = q_Female
End If

Is this the correct code?
Do I place it in the subreport? If so, on which event?
Any help would be appreciated.
 
No guarantees but the using the Detail Format event to manipulate the subreport.
 
I succeeded by placing the code in the "On Activate" event of the parent report.
 

Users who are viewing this thread

Back
Top Bottom