Hi
I am trying to use a variable (= CC) in the following code in an Access Report, so that I can loop through 25 different CC's (only showing 3 here). However, it does not seem to like it. Could somebody please take a look at my code and see what I am doing wrong - maybe it can't be done but I need to know!!
CODE:
Private Sub ReportFooter_Format(Cancel As Integer, FormatCount As Integer)
Dim blnCCTotal As Boolean
Dim cc_num As Integer
Dim CC As Variant
For cc_num = 1 To 3
If cc_num = 1 Then
CC = "160001"
ElseIf cc_num = 2 Then
CC = "160002"
ElseIf cc_num = 3 Then
CC = "160003"
End If
'Determine whether the CCTotal has a value
blnCCTotal = IsNull([CC & ”Grand Total Sum”])
'Set the Visible property for the CC columns
[CC & “Label”].Visible = blnCCTotal
[CC].Visible = blnCCTotal
[“Sum of” & CC].Visible = blnCCTotal
Next cc_num
Thanks
Keza
I am trying to use a variable (= CC) in the following code in an Access Report, so that I can loop through 25 different CC's (only showing 3 here). However, it does not seem to like it. Could somebody please take a look at my code and see what I am doing wrong - maybe it can't be done but I need to know!!
CODE:
Private Sub ReportFooter_Format(Cancel As Integer, FormatCount As Integer)
Dim blnCCTotal As Boolean
Dim cc_num As Integer
Dim CC As Variant
For cc_num = 1 To 3
If cc_num = 1 Then
CC = "160001"
ElseIf cc_num = 2 Then
CC = "160002"
ElseIf cc_num = 3 Then
CC = "160003"
End If
'Determine whether the CCTotal has a value
blnCCTotal = IsNull([CC & ”Grand Total Sum”])
'Set the Visible property for the CC columns
[CC & “Label”].Visible = blnCCTotal
[CC].Visible = blnCCTotal
[“Sum of” & CC].Visible = blnCCTotal
Next cc_num
Thanks
Keza