Programming for footer section



(Using Access 2000 on Windows XP.) I have a report tied to a table. In the
report of the GroupFooter1 section, I need to add code to either the OnFormat
or OnPrint event, I think.

Qty is being added based on a weekly total. I then need to use IF
statements to get the right figure to multiply the total within that week. I
cannot get it straight on what I need to do, and really need some expert help.

Here is the coding for the OnFormat event of the RefDate Footer (the totals
are grouped on the week):
Private Sub GroupFooter1_Format(Cancel As Integer, FormatCount As Integer)
If Me.WeekTot <= 330 Then
Me.WeekPrice = Me.WeekTot * 7.5
ElseIf Me.WeekTot >= 496 < 620 Then
Me.WeekPrice = Me.WeekTot * 5.25
ElseIf Me.WeekTot >= 620 < 744 Then
Me.WeekPrice = Me.WeekTot * 5.1
ElseIf Me.WeekPrice > 743 Then
Me.WeekPrice = Me.WeekTot * 4.9
End If
End Sub

WeekTot is what I have titled the field that will add the Qty field from the
table, and those are calculating correctly inside the group footer.

The unbound control titled WeekPrice is what I am getting to come up;
however, here are the results of the report (note that the numbers in
parentheses should be the multiplier, but the second result for 663 is
INCORRECT and has actually been multiplied by 5.25 and not 5.1):

5 (7.5) = 37.50
663 (5.1) = 3480.75*
544 (5.25) = 2856

Can someone help me figure out what I have done wrong? I know this must be
an error on my part, and I am still learning about VBA. I always use DAO
when I can.

Thank you. --Linda


.



Relevant Pages

  • Re: Summing Calculation Problem
    ... Every time I try to calculate the totals per vendor I get one ... I have tried to set a running sum in the vendor footer but it is not ... I have a header record that contains the backorder qty of an item example 5000 ... PO#1 Qty 3000 Fulfill 3000 ...
    (microsoft.public.access.reports)
  • Re: show only records where NEXT record is different then the prior
    ... > Keep in mind this only suppresses the display, so if you have any totals ... > Qty they will still be included so you might want to use running totals. ... >> If change then variable changes? ...
    (microsoft.public.vb.crystal)
  • Re: show only records where NEXT record is different then the prior
    ... > Keep in mind this only suppresses the display, so if you have any totals ... > Qty they will still be included so you might want to use running totals. ... >> If change then variable changes? ...
    (microsoft.public.vb.crystal)
  • Re: Subtotals
    ... Once I extract the totals and remove the duplicate rows I pass the info to ... Advanced filter also allows you to copy the unique items to another area of your worksheet if that helps. ... I have a list of data consisting of part#'s, vendor, qty, etc... ...
    (microsoft.public.excel.misc)
  • Re: OnPrint event does not execute in between page.
    ... >I have an Access program with report which using unbound fields ... >I put the calculation in the OnPrint event in the Group Footer. ... >Let says I generated a report with 3 pages on a Print Preview mode. ... You will have to find another way to calculate the totals. ...
    (microsoft.public.access.reports)