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
|
|||
|
|||
Line at bottom of Detail section
How can I programmatically know when I am at the last item of detail section
in OnPrint event procedure. I need to make a line visible then and only then. Thanks, Wally |
#2
|
|||
|
|||
Line at bottom of Detail section
Can't you simply use a line at the top of the next section?
Otherwise, you can add a get a count of the number of records by adding a text box to the report header section: Name: txtCountRpt Control Source: =Count(*) Visible: No Then add a text box to the detail section: Name: txtCountDetail Control Source: =1 Running Sum: Over All Visible: No Then in the On Format or On Print event you can compare the values: Me.LineControlName.Visible = (Me.txtCountRpt = Me.txtCountDetail) You could also use the Line method to draw a line if you don't want to use a line control. -- Duane Hookom Microsoft Access MVP "wallymeister" wrote: How can I programmatically know when I am at the last item of detail section in OnPrint event procedure. I need to make a line visible then and only then. Thanks, Wally |
#3
|
|||
|
|||
Line at bottom of Detail section
Hi Duane,
A line at the top of the next section will not print where I need it to in the case that my detail section has fewer records tha a full page. the next section is page footer. Looks like your other suggestion will work for me but, why would I need to add a txtbox to the detail section. I already have code that is counting the times the detail section is firing, so couldn't I just add code something like this... If MyCount = Me.txtCountRpt Then Me.DetailBottomLine.Visible = TRUE End If Either way I'm sure I can get it to work now. Thanks for your quick reply. You guys are awesome. Wally "Duane Hookom" wrote: Can't you simply use a line at the top of the next section? Otherwise, you can add a get a count of the number of records by adding a text box to the report header section: Name: txtCountRpt Control Source: =Count(*) Visible: No Then add a text box to the detail section: Name: txtCountDetail Control Source: =1 Running Sum: Over All Visible: No Then in the On Format or On Print event you can compare the values: Me.LineControlName.Visible = (Me.txtCountRpt = Me.txtCountDetail) You could also use the Line method to draw a line if you don't want to use a line control. -- Duane Hookom Microsoft Access MVP "wallymeister" wrote: How can I programmatically know when I am at the last item of detail section in OnPrint event procedure. I need to make a line visible then and only then. Thanks, Wally |
#4
|
|||
|
|||
Line at bottom of Detail section
Duane,
After trying it my way it didn't work, I would have swore it would but it didn't, so I tried your suggestion and the txtCountRpt in the Header section just retains a value of 7298 which I believe is the total records that are being printed. (several pages) e.g. 7298/41=178 pages. On the last page (p178) the line prints just like I want so I'm thinking that I have to either put that Textbox in Page Section or a Sort/Group Section. Well it didn't work in page Header, so I might have to do something else. Wait, How about if I just change the Running sum to OverGroup. Yeah, that's the ticket. Nope that didn't work either. I'm outta time right now. So I'll be back later tomorrow to see if you have any more suggestions. Sorry so vague, Wally "Duane Hookom" wrote: Can't you simply use a line at the top of the next section? Otherwise, you can add a get a count of the number of records by adding a text box to the report header section: Name: txtCountRpt Control Source: =Count(*) Visible: No Then add a text box to the detail section: Name: txtCountDetail Control Source: =1 Running Sum: Over All Visible: No Then in the On Format or On Print event you can compare the values: Me.LineControlName.Visible = (Me.txtCountRpt = Me.txtCountDetail) You could also use the Line method to draw a line if you don't want to use a line control. -- Duane Hookom Microsoft Access MVP "wallymeister" wrote: How can I programmatically know when I am at the last item of detail section in OnPrint event procedure. I need to make a line visible then and only then. Thanks, Wally |
#5
|
|||
|
|||
Line at bottom of Detail section
I never trust "code that is counting the times the detail section is firing".
I have never had issues with running sums in controls and have answered countless questions where OPs were having issues with "code that is counting the times the detail section is firing". -- Duane Hookom Microsoft Access MVP "wallymeister" wrote: Hi Duane, A line at the top of the next section will not print where I need it to in the case that my detail section has fewer records tha a full page. the next section is page footer. Looks like your other suggestion will work for me but, why would I need to add a txtbox to the detail section. I already have code that is counting the times the detail section is firing, so couldn't I just add code something like this... If MyCount = Me.txtCountRpt Then Me.DetailBottomLine.Visible = TRUE End If Either way I'm sure I can get it to work now. Thanks for your quick reply. You guys are awesome. Wally "Duane Hookom" wrote: Can't you simply use a line at the top of the next section? Otherwise, you can add a get a count of the number of records by adding a text box to the report header section: Name: txtCountRpt Control Source: =Count(*) Visible: No Then add a text box to the detail section: Name: txtCountDetail Control Source: =1 Running Sum: Over All Visible: No Then in the On Format or On Print event you can compare the values: Me.LineControlName.Visible = (Me.txtCountRpt = Me.txtCountDetail) You could also use the Line method to draw a line if you don't want to use a line control. -- Duane Hookom Microsoft Access MVP "wallymeister" wrote: How can I programmatically know when I am at the last item of detail section in OnPrint event procedure. I need to make a line visible then and only then. Thanks, Wally |
#6
|
|||
|
|||
Line at bottom of Detail section
Apparently you withheld important requirements that are still elusive. Your
original posting made no mention of multiple sections or lines. Now you are mentioning something about pages adn groups which weren't part of any earlier specification. Please clear up my confusion by posting your exact requirements. -- Duane Hookom Microsoft Access MVP "wallymeister" wrote: Duane, After trying it my way it didn't work, I would have swore it would but it didn't, so I tried your suggestion and the txtCountRpt in the Header section just retains a value of 7298 which I believe is the total records that are being printed. (several pages) e.g. 7298/41=178 pages. On the last page (p178) the line prints just like I want so I'm thinking that I have to either put that Textbox in Page Section or a Sort/Group Section. Well it didn't work in page Header, so I might have to do something else. Wait, How about if I just change the Running sum to OverGroup. Yeah, that's the ticket. Nope that didn't work either. I'm outta time right now. So I'll be back later tomorrow to see if you have any more suggestions. Sorry so vague, Wally "Duane Hookom" wrote: Can't you simply use a line at the top of the next section? Otherwise, you can add a get a count of the number of records by adding a text box to the report header section: Name: txtCountRpt Control Source: =Count(*) Visible: No Then add a text box to the detail section: Name: txtCountDetail Control Source: =1 Running Sum: Over All Visible: No Then in the On Format or On Print event you can compare the values: Me.LineControlName.Visible = (Me.txtCountRpt = Me.txtCountDetail) You could also use the Line method to draw a line if you don't want to use a line control. -- Duane Hookom Microsoft Access MVP "wallymeister" wrote: How can I programmatically know when I am at the last item of detail section in OnPrint event procedure. I need to make a line visible then and only then. Thanks, Wally |
Thread Tools | |
Display Modes | |
|
|