Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Handling columns in reports

Status
Not open for further replies.

Sauyeng

Programmer
May 21, 2001
4
FR
My report has 8 columns. The data is grouped so that at the end of a reccord, the data appears on the following column.
Since I do not know how many records (there cannot be more than 7 anyway) there are per group, I do not know where the last record will show.
The last record shows data of totals. I need this las record to always appear in column 8, no matter how many records I've got...
I am not too familiar with VBA code in reports but what I need to write in the code is to print the last record in column 8...
Please help!!!
Many thanx ;D
 
Hi,
I am not sure that I understand your problem. Can you show us what you mean? For instance:

Customer Col 1 Col 2 .............. Total
ABC Co. 100.00 200.00 300.00

If this is what you need, the formula needs to be placed in the OnFormat event for the Detail section. It would be like this:
txtTotal = Col1 + Col2 + Col3 + Col4........etc.




HTH, [pc2]
Randy Smith
California Teachers Association
 
Hi,

Thank you for your reply.
This is what I've got:
Zone 1 Zone 2 Zone 3... Zone 6 Total
USA Europe ROW Total
Transport 1000 1000 1000 4000
Services 0 10 0 10
Packaging 20 20 20 60
TOTAL 1020 1030 1020 4070

This is what I want to get. I have no problem calculating the totals. The difficulty is to have it appear under the column Total no matter how many zones I get.
At the moment, when I have 3 zones, the total appear on the 4th column... and on the 5th if I have 4 zones, etc...

I don't know whether I'm more understandable. But thanx for any tips!
 
Hi,
Are any of the columns blank? This, of course, is different than having zeros. If you do have blank columns, you may need to check for nulls with this code in the ControlSource for your total text box:
=IIf(IsNull([Zone1]),0,[Zone1]) + IIf(IsNull([Zone2]),0,[Zone2]) + IIf(IsNull([Zone3]),0,[Zone3]) etc.

HTH, [pc2]
Randy Smith
California Teachers Association
 
Thank you Randy,

I actually found the solution.
I placed a formula in the onFormat that calculates the number of zones I get. I wrote a loop that jumps a culumn, until the zone reaches 8. So the total always appears in column 8.

Thank you very much anyway

A bientôt

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top