create string for footer from detail secton

  • Thread starter Thread starter ChrisA
  • Start date Start date
C

ChrisA

I am trying to create a string of Product No's that I can then display as
one line as opposed to a column in the detail section. I will then make the
detail section hidden. However sometimes it works and sometimes not giving
me extra numbers or none at all. Believe it must be a formatting issue but
not clear how to resolve it. Using the following code.

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
strProducts = strProducts & Format(Me.ProductNo, "!>@@@-@@@@-@@@") & ", "
End Sub


Private Sub GroupFooter2_Print(Cancel As Integer, PrintCount As Integer)
txtProducts = strProducts
strProducts = ""
End Sub

The idea is to use data from the hidden detail secion and show as summary in
the group footer if this is the best way.

Thanks
Chris
 
ChrisA said:
I am trying to create a string of Product No's that I can then display as
one line as opposed to a column in the detail section. I will then make the
detail section hidden. However sometimes it works and sometimes not giving
me extra numbers or none at all. Believe it must be a formatting issue but
not clear how to resolve it. Using the following code.

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
strProducts = strProducts & Format(Me.ProductNo, "!>@@@-@@@@-@@@") & ", "
End Sub


Private Sub GroupFooter2_Print(Cancel As Integer, PrintCount As Integer)
txtProducts = strProducts
strProducts = ""
End Sub

The idea is to use data from the hidden detail secion and show as summary in
the group footer if this is the best way.


Not only is that not the best way, it doesn't work reliably
(as you already noted).

You can change the report's record source query to only
select the unique values for the group and leave out the
products data. The report will then have your grouping data
in the detail section and won't need to do any grouping.

You can then use a function such as Duane's at:
http://www.rogersaccesslibrary.com/...Generic Function To Concatenate Child Records'
to concatenate the list of products in a text box in the
detail section.
 
Thanks for your help. After hunting around the newsgroups decided that by
using a recordset in the groupfooter print event seemed to work well for
each grouping and then cleared the string in the group header.
Chris
 
Back
Top