Connecting Tech Pros Worldwide Help | Site Map

Need to change a control source for a report

Member
 
Join Date: Feb 2007
Location: Minneapolis MN
Posts: 49
#1: Nov 9 '07
Hi
I am trying to change the control source of a control on a report depending on a selection on the form where the report was called from.
Here is the code i have tried:
[code]
Private Sub Report_Open(Cancel As Integer)
If (Forms![frm_Control Center]!fundfltr = "GO") Then
Reports![Copy of rpt_Projlist]![DM levy].Control Source = [GO]
Reports![Copy of rpt_Projlist]![DM levy_Label].Caption = "GO"
End If
End Sub
[code]
Thanks
puppydogbuddy's Avatar
Expert
 
Join Date: May 2007
Location: Florida
Posts: 1,915
#2: Nov 10 '07

re: Need to change a control source for a report


The syntax looks ok at first glance. you did not say what happens when you run your code, so I am guessing that your problem is that the form you referenced for your parameter is not open, and therefore, the "if" statement is not executed properly. Your report should work if you close the form after the report opens.
Reply