473,327 Members | 2,090 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Sub-Report to hide un-checked lines...

Hi,

I have a report with a sub-report.
On the sub-report I have the following data:

Product | Qty | Print (As Checkbox)

What I want to do is hide all lines in the sub-report where the Print
checkbox is UN-CHECKED and show only the lines where the checkbox is
CHECKED.

Also, if possible, I do not want any blank lines where hidden lines
are. Is it possible to remove these blank lines.
How can I get this to work ?
Thanks in advance.
David
Nov 12 '05 #1
4 2032
David wrote:
Hi,

I have a report with a sub-report.
On the sub-report I have the following data:

Product | Qty | Print (As Checkbox)

What I want to do is hide all lines in the sub-report where the Print
checkbox is UN-CHECKED and show only the lines where the checkbox is
CHECKED.

Also, if possible, I do not want any blank lines where hidden lines
are. Is it possible to remove these blank lines.
How can I get this to work ?
Thanks in advance.
David


Lets say the forms are called MF and SF.

Let's say you have a combo box to show filtered records with the values
All, Yes, No

In the afterupdate event you could enter something like
Sub ComboPrint_AfterUpdate
Dim strFilter As STring
Select Case ComboPrint
Case "Yes"
strFilter = "([Print])
Case "No"
strFilter = "(Not [Print])
End Select
Forms!MF!SF.Form.Filter = strFilter 'empty if ALL
Forms!MF!SF.Form.FilterOn = (strFilter > "") 'True if not ALL
End Sub


Nov 12 '05 #2
Salad,

Thanks for your response.
As I explained, this is a report, not a form !

Please can you re-think your reply.
David

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #3
I may be missing the point, but the underlying query for the subreport
should have the line "WHERE Print = True" in it as the criteria.

HTH

Phil
"David Gordon" <da***@scene-double.co.uk> wrote in message
news:40*********************@news.frii.net...
Salad,

Thanks for your response.
As I explained, this is a report, not a form !

Please can you re-think your reply.
David

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 12 '05 #4
David Gordon wrote:
Salad,

Thanks for your response.
As I explained, this is a report, not a form !

Please can you re-think your reply.


Same concept. You simply lack the knowledge of the Reports collection
and its properties and methods. I suggest you do some study in on-line
help.

You could put the following in the OnOpen event of the report
Me.ReportName.Report.Filter = whatever
Me.ReportName.Report.FilterOn = True

Or if calling from a form
Docmd.Openreport "ReportName"
Reports!ReportName!ReportSubForm.Report.Filter = ....
Reports!ReportName!ReportSubForm.Report.FilterOn = True


Nov 12 '05 #5

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

Similar topics

5
by: John Dewbert | last post by:
*** post for FREE via your newsreader at post.newsfeed.com *** Hello, I have trouble passing a folder object (from a FileSystemObject) to a sub procedure. Consider the following code: ...
5
by: Colleyville Alan | last post by:
I have a sub that can do two different tasks based on the value of one variable. So I'd like to have two different buttons on the same form run this, but each one setting a flag so that the...
6
by: lenny | last post by:
Hi, I've been trying to use a Sub or Function in VBA to connect to a database, make a query and return the recordset that results from the query. The connection to the database and the query...
3
by: Kathy Burke | last post by:
Hi, I'm tired, so this question may be silly. I have a fairly long sub procedure. Based on one condition, I load another sub with the following: If Session("GRN") = "complete" Then txtScan.Text...
10
by: tmaster | last post by:
When I try to dynamically add a second sub menu item to this ContextMenu item, I get an error 'Specified argument was out of the range of valid values'. Private Sub mnuTopics_Show_Select(ByVal...
12
by: Ron | last post by:
Greetings, I am trying to understand the rational for Raising Events instead of just calling a sub. Could someone explain the difference between the following 2 scenarios? Why would I want to...
1
by: dBNovice | last post by:
Please help! I have 3 forms: Task, Subtask, Elements. Elements is a subform of Subtask and Subtask is a subform of Task. I am able to navigate from Task to Subform to Element and from Element to...
6
by: Bob | last post by:
Hi, I found this code here below (about cartitems and shoppingcart) and I have two questions about sub New(). In the first class CartItem, there is two times sub New(): Public Sub New() End...
6
by: Greg Strong | last post by:
Hello All, Is is possible to use an ADO recordset to populate an unbound continuous Subform? I've done some Googling without much luck, so this maybe impossible, but let me try to explain...
6
by: Thom Little | last post by:
Using C# 3.5 I have a form that calls many other sub-forms. Typically there will be five forms open at the same time. If the main form is closed all the sub forms are also closed. Is there...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.