If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
How can I make a group not to show/display in a report if no data is under that group?
Hello,
I have this big report that summary a lot of data. Sometimes a group need to be shown if that group has data on it otherwire I dont want to show the group in the report. So, is there an option to not show the group if no data is under a group? Any ideas? Thank You |
#2
|
|||
|
|||
How can I make a group not to show/display in a report if no data is under that group?
erick-flores wrote:
I have this big report that summary a lot of data. Sometimes a group need to be shown if that group has data on it otherwire I dont want to show the group in the report. So, is there an option to not show the group if no data is under a group? Add a text box with the expression =Coount(*) to the group header section. Then use each section's Format event to check the text box and cancel the section: Cancel = (thetextbox = 0) -- Marsh MVP [MS Access] |
#3
|
|||
|
|||
How can I make a group not to show/display in a report if no data is under that group?
Marshall Barton wrote: erick-flores wrote: I have this big report that summary a lot of data. Sometimes a group need to be shown if that group has data on it otherwire I dont want to show the group in the report. So, is there an option to not show the group if no data is under a group? Add a text box with the expression =Coount(*) to the group header section. Then use each section's Format event to check the text box and cancel the section: Cancel = (thetextbox = 0) -- Marsh MVP [MS Access] Because I am grouping by different IDs I cant add another field/expression to my grouping, can I? I read you reply this to anoher person, and I already check for this option Any others suggestions? |
#4
|
|||
|
|||
How can I make a group not to show/display in a report if no data is under that group?
erick-flores wrote:
Marshall Barton wrote: erick-flores wrote: I have this big report that summary a lot of data. Sometimes a group need to be shown if that group has data on it otherwire I dont want to show the group in the report. So, is there an option to not show the group if no data is under a group? Add a text box with the expression =Count(*) to the group header section. Then use each section's Format event to check the text box and cancel the section: Cancel = (thetextbox = 0) Because I am grouping by different IDs I cant add another field/expression to my grouping, can I? I read you reply this to anoher person, and I already check for this option Any others suggestions? If it's not a report group, then I think you need to explain what you mean by "group". Another thought, how can there be data for the report when a "group" has no data? -- Marsh MVP [MS Access] |
#5
|
|||
|
|||
How can I make a group not to show/display in a report if no data is under that group?
Ok, let me explain you. Compressors, Stages, Cylinders, Comp. Valve,
Comp. Parts, Gaskets, Piston, Comp. Rod, Nuts and Piston Rings Compressor has Stage(s) (always) Stage(s) has Cylinder(s) (always) Cylinder can have Comp. Valve, Gaskets or Piston Comp. Valve can have Comp. Parts Cylinder can has Gasket Piston can have Comp. Rod or Nuts Nuts can have Piston Rings So this si kind of the idea. I want to see my report first. group by: 1. Compressor (cmp_id) 2. Stages (stg_id) 3. Cylinders (cyl_id) 4. and then all the other components from the cylinders. What I am doing: 1st group cmp_id 2nd group stg_id 3rd group cyl_id 4th group Comp Valve 5th group Comp. Parts .. .. .. So I was thinking if a Cylinder only has a Gasket then only display the gasket group. I think there should be a better way of doing this, but I dont know |
#6
|
|||
|
|||
How can I make a group not to show/display in a report if no data is under that group?
Also when there is no data under a group, the others groups will not work. So the hold report will display no data. It will only show the group headers. How can I fix this? any ideas? |
#7
|
|||
|
|||
How can I make a group not to show/display in a report if no data is under that group?
erick-flores wrote:
Ok, let me explain you. Compressors, Stages, Cylinders, Comp. Valve, Comp. Parts, Gaskets, Piston, Comp. Rod, Nuts and Piston Rings Compressor has Stage(s) (always) Stage(s) has Cylinder(s) (always) Cylinder can have Comp. Valve, Gaskets or Piston Comp. Valve can have Comp. Parts Cylinder can has Gasket Piston can have Comp. Rod or Nuts Nuts can have Piston Rings So this si kind of the idea. I want to see my report first. group by: 1. Compressor (cmp_id) 2. Stages (stg_id) 3. Cylinders (cyl_id) 4. and then all the other components from the cylinders. What I am doing: 1st group cmp_id 2nd group stg_id 3rd group cyl_id 4th group Comp Valve 5th group Comp. Parts . . . So I was thinking if a Cylinder only has a Gasket then only display the gasket group. I think there should be a better way of doing this, but I dont know That seems like a good way to do it. As far as I can tell from your description, I still think you can use a text box named txtValveCount in the Valve group's header section with the expression =Count(*) Then the section can be suppressed by adding a line of code to its Format event: Cancel = (Me.txtValveCount = 0) Repeat the same kind of thing in each group header. If I am still misunderstanding what you are saying, please post a Copy/Paste of the report's record source query along with some explanation of how the fields are used in the report. -- Marsh MVP [MS Access] |
#8
|
|||
|
|||
How can I make a group not to show/display in a report if no data is under that group?
As far as I can tell from your description, I still think
you can use a text box named txtValveCount in the Valve group's header section with the expression =Count(*) Then the section can be suppressed by adding a line of code to its Format event: Cancel = (Me.txtValveCount = 0) Repeat the same kind of thing in each group header. I think I dont quite understand what you mean, if I go to Sorting and Grouping in my report, under the Field/Expression colunm I have: cmp_id stg_id cyl_id etc So the header of my group shows: cmp_id Header, stg_id Header, etc Do you mean add in that Field/Expression "=Count(*)"? So the name of the group would be "Count(*) Header" is that what you mean. And the txtValveCount, I cant add a textbox to the header, it wouldnt let me. Maybe I am getting the wrong idea, perhaps I can use the txtValveCount. If you can please guide me step by step I will really appreciatted Thank you |
#9
|
|||
|
|||
How can I make a group not to show/display in a report if no data is under that group?
erick-flores wrote:
As far as I can tell from your description, I still think you can use a text box named txtValveCount in the Valve group's header section with the expression =Count(*) Then the section can be suppressed by adding a line of code to its Format event: Cancel = (Me.txtValveCount = 0) Repeat the same kind of thing in each group header. I think I dont quite understand what you mean, if I go to Sorting and Grouping in my report, under the Field/Expression colunm I have: cmp_id stg_id cyl_id etc So the header of my group shows: cmp_id Header, stg_id Header, etc Do you mean add in that Field/Expression "=Count(*)"? So the name of the group would be "Count(*) Header" is that what you mean. And the txtValveCount, I cant add a textbox to the header, it wouldnt let me. Maybe I am getting the wrong idea, perhaps I can use the txtValveCount. No, no, not that at all. Add a text box to the Valve group header. Double click on this new text box to bring up its property sheet. Find the Name property and type an appropriate name (e.g. txtValveCount). Find the ControlSource property and type =Count(*) Now find the OnFormat property and select [Event Procedure] from the drop down list. Then click on the builder button in the right margin (the button with three dots). That should take you to the headersection's Format event procedure. Then just type the line: Cancel = (Me.txtValveCount = 0) into the procedure. Test the report to see if the Valve section does what you want when there are no valves. If it does, repeat the above process for each of the other group header sections. -- Marsh MVP [MS Access] |
#10
|
|||
|
|||
How can I make a group not to show/display in a report if no data is under that group?
Add a text box to the Valve group header.
I add a text box to the fields under the Valve group header name: gskCount. But not in the "group header" When you say "Add a text box to the Valve group header" that for me is create/add a text box inside the group header, where right now the field is gsk_id. So I dont see how I can add a text box to the group header. So I add it under the fields under my group header. It did work when there is data under that group. I can see the textbox counting the data. But when there is no data an error will occur. "Run-time error '2427': You entered an expression that has no value." And it will highlight the "Cancel = (Me.gskCount = 0)" My code behind the OnFormat is: Private Sub GroupHeader6_Format(Cancel As Integer, FormatCount As Integer) Cancel = (Me.gskCount = 0) End Sub I am doing something wrong? Thank you |
Thread Tools | |
Display Modes | |
|
|