472,133 Members | 1,180 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,133 software developers and data experts.

Need to change a control source for a report

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:
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
Nov 9 '07 #1
1 2896
1,923 Expert 1GB
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.
Nov 10 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.