Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

subreport not working

Status
Not open for further replies.

Ielamrani

MIS
Jul 7, 2005
183
US
Hi,
This is driving me crazy.
I have a report (let call it Report1) with the following code:


Private Sub Report_Activate()

If Me.Memo = "CONTRACT TYPE: INDIVIDUAL" Then
Me.Check39 = False
Me.Check51 = True
Me.Label49.Visible = False
Me.Text37.Visible = False
Else

Me.Check39 = True
Me.Check51 = False
Me.Label49.Visible = True
Me.Text37.Visible = True
End If

End Sub

Report1 works fine and the code does what I want it to do but the code does not work if I made it subreport of another report.


Thanks in advance
 
There is a different syntax for referencing a subreport. You need to include the name of the main report as well.

Look in Access Help for the specifics on referencing a subreport.
 
You're right, my boss just told me the same thing. I will include the name of the main report and subreport.
Thanks
 
Is there a reason why you are using the "Activate" event of the report? Have you tried the code in the On Format event of the report section that contains the controls?

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top