L
Linda Brown
(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
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