469,127 Members | 1,371 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,127 developers. It's quick & easy.

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 2809
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

1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by Mortomer39 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.