1509a Can a checkbox on a form control whether a report displays a subreport?
Sign Up |  Live StatsLive Stats    Articles 37,470| Comments 178,649| Members 19,495, Newest singhajay| Online 455
Home Contact
 (Forgotten?): 
    10 years of Excellence
    For best SPN experience, use Firefox Internet Browser!


                                                                   Your Banner Here!    




Click Here to Register/Sign Up Daily Hukamnama Member Blogs Downloads Website Navigation Help Fonts Tags
Sikh Philosophy Network » Sikh Philosophy Network » Current News » Information Technology » Can a checkbox on a form control whether a report displays a subreport?

Can a checkbox on a form control whether a report displays a subreport?

Our Donation Goal : Why Donate? : Donate Today! : Donate Anonymously (ਗੁਪਤ) : Our Family of Supporters
Goal this month: 500 USD, Received: 0 USD (0%)
Please Donate...
     
Related Topics...
Thread Thread Starter Forum Replies Last Post
Addressing subreport groups from a main report Darrell Information Technology 0 28-Jul-2006 08:35 AM
how to import data from main report to a subreport Pun Information Technology 1 28-Jul-2006 08:22 AM
Subreport showing up Blank(white) on a report pokdbz Information Technology 3 17-Nov-2005 18:02 PM
Report with subreport Roger Bell Information Technology 1 09-Nov-2005 17:50 PM
cancel report if subreport has no data hughess7 Information Technology 2 28-Oct-2005 18:00 PM


Tags
checkbox, form, control, whether, report, displays, subreport
Reply Post New Topic In This Forum Stay Connected to Sikhism, Click Here to Register Now!
  #1 (permalink)  
Old 28-Jul-2006, 08:17 AM
Gijs van Swaaij's Avatar Gijs van Swaaij
Guest
 
Posts: n/a
   
   
Can a checkbox on a form control whether a report displays a subreport?

  Donate Today!   Email to Friend  Tell a Friend   Show Printable Version  Print   Contact sikhphilosophy.net Administraion for any Suggestions, Ideas, Feedback.  Feedback  

Register to Remove Advertisements
Hey everyone,

I have a form in my database (frmRes) that lets users select several
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/information-technology/11036-can-checkbox-form-control-whether-report.html
criteria, based on which a report (repRes) is made. For instance, the
user can choose to show only those data that relate to a specific
person. This is done by generating a where clause in a VBA script when
the user clicks "OK". After the where clause has been generated, the
script loads the report repRes with it.

Now the problem is: frmRes has a checkbox on it (chkShowSub) that
should control whether or not repRes will display a subreport. If it is
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=11036
selected, the subreport should be visible, otherwise it should be
hidden. Is there a way to make my form do this? I don't see a good way
to include this in my where clause without seriously hacking the way
the report is generated - and that would be some ugly hack! Ideas?

Thanks,
Gijs van Swaaij



Do you agree or disagree with the writer above? Why not share your immediate thoughts with us! Login Now! or Sign Up Today! to share your views... Gurfateh!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 28-Jul-2006, 08:17 AM
Allen Browne's Avatar Allen Browne
Guest
 
Posts: n/a
   
   
Re: Can a checkbox on a form control whether a report displays a subreport?

1. Open the query that feeds your subreport, in design view.

2. In a fresh column in the Field row, enter:
[Forms].[frmRes].[chkShowSub]
3. In the Criteria row under this, enter:
True
The query will not have no records unless the box is not checked.
Consequently, the subreport will have no records either.

If you don't want to tie the subreport to the query, you could do it
programmatically through the LinkMasterFields/LinkChildFields of the
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=11036
subreport control.

1. Add a check box to the subreport and set these properties:
Name chkAlwaysTrue
Control Source =-1
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=11036
Visible No

2. Add a check box to the main report. Leave its Control Source blank, and
set thes properties:
Name chkShowSubRpt
Visible No

3. Add these names to the LinkMasterFields and LinkChildFields of the
subreport. For example, if you already have:
Link Child Fields ClientID
Link Master Fields ClientID
change it to:
Link Child Fields [ClientID]; [chkAlwaysTrue
Link Master Fields [ClientID]; [chkShowSubRpt]

4. In the Open event procedure of the report, test if Forms!frmRes is
loaded, and if so set the value of chkShowSubRpt based on how it is set.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Gijs van Swaaij" wrote in message
news:1149767752.190036.220910@c74g2000cwc.googlegr oups.com...
> Hey everyone,
>
> I have a form in my database (frmRes) that lets users select several
> criteria, based on which a report (repRes) is made. For instance, the
> user can choose to show only those data that relate to a specific
> person. This is done by generating a where clause in a VBA script when
> the user clicks "OK". After the where clause has been generated, the
> script loads the report repRes with it.
>
> Now the problem is: frmRes has a checkbox on it (chkShowSub) that
> should control whether or not repRes will display a subreport. If it is
> selected, the subreport should be visible, otherwise it should be
> hidden. Is there a way to make my form do this? I don't see a good way
> to include this in my where clause without seriously hacking the way
> the report is generated - and that would be some ugly hack! Ideas?
>
> Thanks,
> Gijs van Swaaij



Reply With Quote
  #3 (permalink)  
Old 28-Jul-2006, 08:17 AM
Gijs van Swaaij's Avatar Gijs van Swaaij
Guest
 
Posts: n/a
   
   
Re: Can a checkbox on a form control whether a report displays a subreport?

  Donate Today!  
Thanks a lot for your help! I used the first method you described, and
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=11036
it works now.

Reply With Quote
   Click Here to Donate Now!

Support Us!
Become a Promoter!
Gurfateh ji, you can become a SPN Promoter by Donating as little as $10 each month. With limited resources & high operational costs, your donations make it possible for us to deliver a quality website and spread the teachings of the Sri Guru Granth Sahib Ji, to serve & uplift humanity. Every contribution counts. Donate Generously. Gurfateh!
ReplyPost New Topic In This Forum Stay Connected to Sikhism, Click Here to Register Now!

Bookmarks


(View-All Members who have read this thread : 0
There are no names to display.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Tools Search
Search:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On

» Active Discussions
English Sri Guru Granth Sahib Ji Translations
By sikh15
Today 22:27 PM
5 Replies, 76 Views
Sikh Philosophy Network...
Today 22:26 PM
16 Replies, 746 Views
Can Sikhs worship...
By sikh15
Today 22:20 PM
10 Replies, 71 Views
Sikh Spokesman (ਪੰਜਾਬੀ...
Today 21:25 PM
256 Replies, 6,067 Views
Difference in Bowing...
By Kamala
Today 15:08 PM
11 Replies, 257 Views
What Really Happened on...
Today 12:46 PM
13 Replies, 213 Views
Free Online Gurbani...
Today 03:56 AM
13 Replies, 4,339 Views
English Sri Guru Granth...
Today 03:51 AM
5 Replies, 170 Views
Edward Snowden: the...
Today 03:34 AM
3 Replies, 185 Views
Rozana Reports (ਪੰਜਾਬੀ...
Today 03:23 AM
407 Replies, 9,438 Views
What Is Difference...
Yesterday 09:18 AM
6 Replies, 183 Views
First There is Water by...
By Ishna
Yesterday 05:03 AM
3 Replies, 190 Views
Cooking Without Alcohol
Yesterday 02:12 AM
12 Replies, 200 Views
Learning from Baba...
Yesterday 01:38 AM
0 Replies, 312 Views
Eckhart Tolle
17-Jun-2013 18:08 PM
2 Replies, 130 Views
» Books You Should Read...
Powered by vBadvanced CMPS v3.2.3
All times are GMT +6.5. The time now is 22:29 PM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
Search Engine Optimization by vBSEO 3.6.0 PL2 Copyright © 2004-12, All Rights Reserved. Sikh Philosophy Network


Page generated in 0.38735 seconds with 32 queries
0