Need to change a control source for a report

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cwby1966
    New Member
    • Feb 2007
    • 49

    Need to change a control source for a report

    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(Can cel 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
    Recognized Expert Top Contributor
    • May 2007
    • 1923

    #2
    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.

    Comment

    Working...