Wrox Programmer Forums
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 28th, 2004, 08:16 PM
Registered User
 
Join Date: Aug 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to greig_whitney Send a message via MSN to greig_whitney
Default Access Reports

Is there a way to choose 1 of 2 different subreports based on a field in the main report? For example, if Canadian Currency is checked off, a subreport where the calculations are done in Canadian dollars is printed along with the rest of the main report. If Canadian dollars is null, a different subreport is inserted into the main report.

Thanks.

Greig

 
Old August 31st, 2004, 12:01 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

Yes, on the main report's detail section's ON FORMAT event, you can put something like this:

If Me.chkCanada Then
    Me.srpMySubReport.SourceObject = "srpCanada"
Else
    Me.srpMySubReport.SourceObject = "srpUSA"
End If

I'm using fake names for the checkbox, subreport control, and subreport names. Use yours.


Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division





Similar Threads
Thread Thread Starter Forum Replies Last Post
Crystal Reports and Access Database solemgar Crystal Reports 0 August 18th, 2005 02:35 PM
Reports in access nikotromus Access VBA 4 July 31st, 2005 12:57 AM
Rounding in Access Reports ebs Access 1 December 19th, 2004 05:18 AM
Access reports pankaj_daga Access 4 March 8th, 2004 10:55 AM
ASP and Access Reports cascade Classic ASP Databases 0 June 12th, 2003 05:19 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.