Sign Up |  Live StatsLive Stats    Articles 35,345| Comments 159,788| Members 17,820, Newest waheguruhelpme| Online 213
Home Contact
 (Forgotten?): 
    Sikhism

   
                                                                     Your Banner Here!    

Sikh Philosophy Network » Sikh Philosophy Network » Current Affairs » 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: 400 USD, Received: 35 USD (9%)
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
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
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/information-technology/11036-can-checkbox-form-control-whether-report.html
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
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=11036
the report is generated - and that would be some ugly hack! Ideas?

Thanks,
Gijs van Swaaij




 
Do share your immediate thoughts or reactions on this issue? We value your views! Login Now! or Sign Up Today! to share your views with us.. 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
subreport control.

1. Add a check box to the subreport and set these properties:
Name chkAlwaysTrue
Control Source =-1
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
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=11036
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
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=11036
> 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
it works now.
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=11036

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

» Gurbani Jukebox
Listen to Gurbani while surfing SPN!
» Active Discussions
sikhism Who is "Mohan"?
Today 06:52 AM
21 Replies, 319 Views
sikhism need urgent advice.......
Today 06:46 AM
6 Replies, 72 Views
sikhism ਨਾਮਾ
Today 06:37 AM
2 Replies, 45 Views
sikhism Sikh Diamonds Video...
Today 04:23 AM
6 Replies, 112 Views
sikhism Are Creator and Creation...
Today 01:30 AM
44 Replies, 2,833 Views
sikhism Herman Hesse,...
Today 00:54 AM
13 Replies, 225 Views
sikhism On a Scale of Most...
Yesterday 21:42 PM
30 Replies, 1,277 Views
sikhism I became victim by...
Yesterday 19:50 PM
0 Replies, 39 Views
sikhism How important is Matha...
By Ishna
Yesterday 19:05 PM
58 Replies, 1,026 Views
sikhism Sikh Books downloads
Yesterday 15:39 PM
2 Replies, 62 Views
sikhism Salok Sheikh Farid ji...
Yesterday 09:35 AM
0 Replies, 43 Views
sikhism In Punjab, three farmers...
Yesterday 05:36 AM
0 Replies, 45 Views
sikhism Supernatural Sikhs, what...
Yesterday 03:45 AM
19 Replies, 408 Views
sikhism Sukhmani Sahib Astpadi...
26-May-2012 22:57 PM
0 Replies, 46 Views
Do You Think You Are...
26-May-2012 09:59 AM
94 Replies, 8,258 Views
» Books You Should Read...
Powered by vBadvanced CMPS v3.2.2

All times are GMT +6.5. The time now is 07:12 AM.
Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.5.2 Copyright © 2004-12, All Rights Reserved. Sikh Philosophy Network


Page generated in 0.35506 seconds with 30 queries