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
|
|||
|
|||
Refering to SubReport HasData
Hi all
am using: If MySubReport.Report.HasData Then ReportHeaderTectBox.Visible = False ReportHeader0.Height = 0 End If To refer to the subforms HasData property. But I am getting real strange responce. All I am trying to do is make "ReportHeader" go away when sub has data and visible again when not. Is this correct format and if so what else could be wrong? Thank you |
#2
|
|||
|
|||
Refering to SubReport HasData
Strange Response? What do you mean by that.
Trouble shooting suggestion. Try leaving ReportHeader0.Height = 0 out of the code and see what happens. Also, I would expect that you want to set the controls visibility to True if HasData is False and False if HasData is True. You could use something like the following to do that. ReportHeaderTectBox.Visible = Not(MySubReport.Report.HasData ) Where are you executing this code snippet? "Derek Brown" wrote in message ... Hi all am using: If MySubReport.Report.HasData Then ReportHeaderTectBox.Visible = False ReportHeader0.Height = 0 End If To refer to the subforms HasData property. But I am getting real strange responce. All I am trying to do is make "ReportHeader" go away when sub has data and visible again when not. Is this correct format and if so what else could be wrong? Thank you |
#3
|
|||
|
|||
Refering to SubReport HasData
Is it the Report Header of the main Report or the Report Header of the
Report embedded in the Subreport Control that you want to make invisible? If the latter, you need to qualify the reference. I am not certain what you are trying to do by setting the Height to 0. If you could clarify what you are trying to accomplish rather than showing the way you thought you were going to implement it, someone might have a useful suggestion. Larry Linson Microsoft Access MVP "Derek Brown" wrote in message ... Hi all am using: If MySubReport.Report.HasData Then ReportHeaderTectBox.Visible = False ReportHeader0.Height = 0 End If To refer to the subforms HasData property. But I am getting real strange responce. All I am trying to do is make "ReportHeader" go away when sub has data and visible again when not. Is this correct format and if so what else could be wrong? Thank you |
#4
|
|||
|
|||
Refering to SubReport HasData
Hi John The reason for the reverse of the obvious is as follows: Duane Hookom gave me a brilliant suggestion of how to get a day and date heading for a diary that lists appointments. But in true diary fassion you want a report that shows days where no appointments exist, if only so you can book available free days. As you know reports only print available records. Duane's idea is that you design a report based on a static table that just has one field with values 1 - 31 that you add to a predifined date ie beginning of current month and in the detail you drop a report that shows any appointments on the day calculated from the 1-31 + the start date report. Works brilliant except that when you try to group the appointments. If you group the main report heading with the "with first detail" Access treats the whole subreport as the first detail, which is no problem if only one appointment for that day exists but when there are 5 for example the grouping forces the whole group onto the next page leaving large areas of white space. To group correctly I need to have the heading in the subreport unless there are no appointments and then I need to show a heading on the main report. God it's complicated but I will not be happy until it's right. The code could run from the subreport on NoData or the main report on Subreport HasData. If you can solve this I would be most greatfull. "John Spencer" wrote in message ... Strange Response? What do you mean by that. Trouble shooting suggestion. Try leaving ReportHeader0.Height = 0 out of the code and see what happens. Also, I would expect that you want to set the controls visibility to True if HasData is False and False if HasData is True. You could use something like the following to do that. ReportHeaderTectBox.Visible = Not(MySubReport.Report.HasData ) Where are you executing this code snippet? "Derek Brown" wrote in message ... Hi all am using: If MySubReport.Report.HasData Then ReportHeaderTectBox.Visible = False ReportHeader0.Height = 0 End If To refer to the subforms HasData property. But I am getting real strange responce. All I am trying to do is make "ReportHeader" go away when sub has data and visible again when not. Is this correct format and if so what else could be wrong? Thank you |
#5
|
|||
|
|||
Refering to SubReport HasData
Thanks Larry
The report header I am trying to hide is on the main form. When the subreport has data the heading of the subreport needs to be visible. If subreport has no data then the heading of the main report needs to be visible. The reason for the heading of the main report height setting of 0 is to remove the empty space left by the invisible control on the main form. allowing the subreport to move to the top of the page On the main form and subform each heading only shows the day and date. The problem is I need to show one or the other depending on wether the subreport has or has not got data. "Larry Linson" wrote in message ... Is it the Report Header of the main Report or the Report Header of the Report embedded in the Subreport Control that you want to make invisible? If the latter, you need to qualify the reference. I am not certain what you are trying to do by setting the Height to 0. If you could clarify what you are trying to accomplish rather than showing the way you thought you were going to implement it, someone might have a useful suggestion. Larry Linson Microsoft Access MVP "Derek Brown" wrote in message ... Hi all am using: If MySubReport.Report.HasData Then ReportHeaderTectBox.Visible = False ReportHeader0.Height = 0 End If To refer to the subforms HasData property. But I am getting real strange responce. All I am trying to do is make "ReportHeader" go away when sub has data and visible again when not. Is this correct format and if so what else could be wrong? Thank you |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Parameterizing subreports | Jack | Setting Up & Running Reports | 8 | October 21st, 2005 12:00 PM |
Testing subreport for HasData | WB | Setting Up & Running Reports | 1 | April 15th, 2005 11:49 PM |
repeating records in a subreport | Paul James | Setting Up & Running Reports | 2 | February 2nd, 2005 06:11 PM |
SubReport No Data printing problem | Tony_VBACoder | Setting Up & Running Reports | 1 | August 9th, 2004 10:10 PM |
Problems totalling subreport data on main report (A-2002) | Marshall Barton | Setting Up & Running Reports | 0 | June 23rd, 2004 08:01 PM |