473,395 Members | 1,341 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,395 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 2034
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
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...

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.