473,585 Members | 2,552 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Code To Prevent Printing A Subreport

Tom
I have a subreport that can contain one or two pictures per page. The
subreport is similar to an appendix to the main report. The recordsource
contains a field "IncludeInRepor t" (Yes/No) for each picture record. What
code do I use and where does it go to prevent printing the subreport if
there are no picture records marked "Yes" in the "IncludeInRepor t" field?

Thanks,

Tom
Nov 13 '05 #1
5 2195
Create a query to use as the RecordSource of your subreport.

In the Criteria row of the query, under the IncludeInReport field, enter:
True

--
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.

"Tom" <no***@email.co m> wrote in message
news:%1******** *********@newsr ead3.news.atl.e arthlink.net...
I have a subreport that can contain one or two pictures per page. The
subreport is similar to an appendix to the main report. The recordsource
contains a field "IncludeInRepor t" (Yes/No) for each picture record. What
code do I use and where does it go to prevent printing the subreport if
there are no picture records marked "Yes" in the "IncludeInRepor t" field?

Nov 13 '05 #2
Tom
Allen,

Thanks for your response!

Please reread my post. I want to know how and where to code to prevent
printing the subreport when there are no records marked Yes in the
IncludeInReport field.

Thanks,

Tom
"Allen Browne" <Al*********@Se eSig.Invalid> wrote in message
news:42******** *************** @per-qv1-newsreader-01.iinet.net.au ...
Create a query to use as the RecordSource of your subreport.

In the Criteria row of the query, under the IncludeInReport field, enter:
True

--
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.

"Tom" <no***@email.co m> wrote in message
news:%1******** *********@newsr ead3.news.atl.e arthlink.net...
I have a subreport that can contain one or two pictures per page. The
subreport is similar to an appendix to the main report. The recordsource
contains a field "IncludeInRepor t" (Yes/No) for each picture record. What
code do I use and where does it go to prevent printing the subreport if
there are no picture records marked "Yes" in the "IncludeInRepor t" field?


Nov 13 '05 #3
Tom, I would never consider doing that in code, when you could elimiate the
records in the *query* that the subreport is based on, so that no code is
needed.

Is there a special reason you wish to use code?

--
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.

"Tom" <no***@email.co m> wrote in message
news:Bs******** *********@newsr ead3.news.atl.e arthlink.net...
Allen,

Thanks for your response!

Please reread my post. I want to know how and where to code to prevent
printing the subreport when there are no records marked Yes in the
IncludeInReport field.

Thanks,

Tom
"Allen Browne" <Al*********@Se eSig.Invalid> wrote in message
news:42******** *************** @per-qv1-newsreader-01.iinet.net.au ...
Create a query to use as the RecordSource of your subreport.

In the Criteria row of the query, under the IncludeInReport field, enter:
True

"Tom" <no***@email.co m> wrote in message
news:%1******** *********@newsr ead3.news.atl.e arthlink.net...
I have a subreport that can contain one or two pictures per page. The
subreport is similar to an appendix to the main report. The recordsource
contains a field "IncludeInRepor t" (Yes/No) for each picture record. What
code do I use and where does it go to prevent printing the subreport if
there are no picture records marked "Yes" in the "IncludeInRepor t" field?

Nov 13 '05 #4
Tom
The subreport has titles and a logo. It prints when there are no records
marked Yes in the IncludeInReport field.

Tom
"Allen Browne" <Al*********@Se eSig.Invalid> wrote in message
news:42******** *************** @per-qv1-newsreader-01.iinet.net.au ...
Tom, I would never consider doing that in code, when you could elimiate
the records in the *query* that the subreport is based on, so that no code
is needed.

Is there a special reason you wish to use code?

--
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.

"Tom" <no***@email.co m> wrote in message
news:Bs******** *********@newsr ead3.news.atl.e arthlink.net...
Allen,

Thanks for your response!

Please reread my post. I want to know how and where to code to prevent
printing the subreport when there are no records marked Yes in the
IncludeInReport field.

Thanks,

Tom
"Allen Browne" <Al*********@Se eSig.Invalid> wrote in message
news:42******** *************** @per-qv1-newsreader-01.iinet.net.au ...
Create a query to use as the RecordSource of your subreport.

In the Criteria row of the query, under the IncludeInReport field,
enter:
True

"Tom" <no***@email.co m> wrote in message
news:%1******** *********@newsr ead3.news.atl.e arthlink.net...
I have a subreport that can contain one or two pictures per page. The
subreport is similar to an appendix to the main report. The recordsource
contains a field "IncludeInRepor t" (Yes/No) for each picture record.
What code do I use and where does it go to prevent printing the
subreport if there are no picture records marked "Yes" in the
"IncludeInR eport" field?


Nov 13 '05 #5
That doesn't happen in my copy of Access.
If there are no records in the subreport, nothing gets printed.

What you are asking for can be done by testing the HasData property of the
report in the subreport control, in the Format event of the main report
section, or by performing a DLookup() on related records to see if there are
any, and then toggling the Visible property of the main report section that
contains the subreport or setting the runtime properties PrintSection and
MoveLayout. However, it makes no sense to me to do it that way.

--
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.

"Tom" <no***@email.co m> wrote in message
news:4c******** *********@newsr ead3.news.atl.e arthlink.net...
The subreport has titles and a logo. It prints when there are no records
marked Yes in the IncludeInReport field.

Tom
"Allen Browne" <Al*********@Se eSig.Invalid> wrote in message
news:42******** *************** @per-qv1-newsreader-01.iinet.net.au ...
Tom, I would never consider doing that in code, when you could elimiate
the records in the *query* that the subreport is based on, so that no
code is needed.

Is there a special reason you wish to use code?

"Tom" <no***@email.co m> wrote in message
news:Bs******** *********@newsr ead3.news.atl.e arthlink.net...
Allen,

Thanks for your response!

Please reread my post. I want to know how and where to code to prevent
printing the subreport when there are no records marked Yes in the
IncludeInReport field.

Thanks,

Tom
"Allen Browne" <Al*********@Se eSig.Invalid> wrote in message
news:42******** *************** @per-qv1-newsreader-01.iinet.net.au ...
Create a query to use as the RecordSource of your subreport.

In the Criteria row of the query, under the IncludeInReport field,
enter:
True

"Tom" <no***@email.co m> wrote in message
news:%1******** *********@newsr ead3.news.atl.e arthlink.net...
>I have a subreport that can contain one or two pictures per page. The
>subrepor t is similar to an appendix to the main report. The
>recordsour ce contains a field "IncludeInRepor t" (Yes/No) for each
>picture record. What code do I use and where does it go to prevent
>printing the subreport if there are no picture records marked "Yes" in
>the "IncludeInRepor t" field?

Nov 13 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
934
by: Peter Royle | last post by:
I have a strange problem - I just changed from an inkjet to a laser printer - and my VB.NET source code won't print. I see the title at the top of the page, and the little arrows where a line has wrapped - and that's it! I have been into the Tools/Options, set my foreground colour to black and background to white (and tried automatic) -...
1
1736
by: Melissa | last post by:
Sorry if this becomes a repeat! I am having trouble with my newsreader and don't know if this got posted yeserday or not or if anyone responded. A form in my database has multiple subforms. If any subform has no data, the borders of the subform still display on screen and also are printed if I print the main form. Reports are different. If a...
1
7251
by: galivio | last post by:
I have a site project and one of the required features is to be able to print contents (only texts) on the page. It's just like a one click button and the text will be printed. My idea before was to open the text file in adobe reader and there the user can print using the adobe reader print button, but this is not a good way since the contents to...
4
1500
by: gregjgman | last post by:
I'm looking for some code (html, javascript or otherwise) that I can embed into my web site so that when the user clicks on one button, they can send all hyperlinked documents on the page to a printer. Any ideas?
3
1676
by: anilbora007 | last post by:
hi, Any body can help me with my problem? I need coding for printing in DOS mode in C. With Regards Anil Bora
3
1891
Tenneyson
by: Tenneyson | last post by:
Hi I ve been tasked to develop a payment system for an insurance company using VB6.0. My problem lies at the cash office department where receipts have to be printed using a POS printer. How can i develop such a code using VB6? please e-mail me as well mail id removed Tenneyson
3
7842
Tenneyson
by: Tenneyson | last post by:
Hi Can anybody help! how do i format this code so that the results printed will be aligned. E.G. should print like this First Funeral Assurance Co. PolicyNo : F000001 Name : Tenneyson Katunga Premium : $100.00
0
1549
by: menyki | last post by:
pls i designed a database application using visual basic. i have done the coding for the print incase i want to print out the data. Pls my problem is how to code at design time for the application to print the data in a tabular form. for now the records prints ontop of each other, i want the records and the field separated by rows and cells of...
0
918
by: ahok80 | last post by:
i want to know code print subreport in vb.net. when i print subreport, why my printer printing main report?
0
7908
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7836
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8336
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7950
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
5389
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3835
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2343
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1447
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1175
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.