Change sub report in code

  • Thread starter mattc66 via AccessMonster.com
  • Start date
M

mattc66 via AccessMonster.com

Hi I have a form with a subform located in the page header. This subform
contains the logo and address information.

Based on the a control on the main report I would like to change the
subreport.

I placed the following code in the pageheader. However I am not sure how to
format the source object syntax.

Private Sub PageHeader0_Format(Cancel As Integer, FormatCount As Integer)
If Me.Brand = "AMEREC" Then
Me.SOURCE.Object = Report.rptAmerec
ElseIf Me.Brand = "FINNLEO" Then
Me.SOURCE.Object = Report.rptFinnleo
End If
End Sub

Thanks
Matt
 
D

Duane Hookom

I would stack the subreports and make one or the other invisible based on the
value of Brand.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top