A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Line at bottom of Detail section



 
 
Thread Tools Display Modes
  #1  
Old April 8th, 2010, 05:23 PM posted to microsoft.public.access.reports
wallymeister
external usenet poster
 
Posts: 26
Default 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  
Old April 8th, 2010, 06:21 PM posted to microsoft.public.access.reports
Duane Hookom
external usenet poster
 
Posts: 7,177
Default 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  
Old April 8th, 2010, 07:07 PM posted to microsoft.public.access.reports
wallymeister
external usenet poster
 
Posts: 26
Default 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  
Old April 8th, 2010, 09:25 PM posted to microsoft.public.access.reports
wallymeister
external usenet poster
 
Posts: 26
Default 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  
Old April 8th, 2010, 09:31 PM posted to microsoft.public.access.reports
Duane Hookom
external usenet poster
 
Posts: 7,177
Default 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  
Old April 8th, 2010, 11:01 PM posted to microsoft.public.access.reports
Duane Hookom
external usenet poster
 
Posts: 7,177
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 06:56 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.