V
vvwetwet
Hello,
I have a question about how to count the number or records in a report
my report runs a query on some tables and display the records on it.
in the report, it has a field [LastName], how can I count the number of
records that the [LastName] = "Powell" for example and display the
number of count in the report header?
I tried to make a function in VB for example
Public Static Function Total_Number_Last_name(ArrLastname() As Object)
Dim S As Integer
Dim R As Integer
Dim I As Integer
R = 0
For I = LBound(ArrLastname ) To UBound(ArrLastname )
If ArrLastname (I) <> "Powell" Then
Else
R = R + 1
End If
Next I
Total_Number_Last_Name= ArrRequestType
End Function
and call this function in one of the textbox in my report using
=Total_Number_Last_name([LastName])
However, I found that when I am calling this function from the report
heder, it does'nt seem recognize [LastName] as an array and give me
an "#error"
but if I change my function's argument type to (ArrLastname As Object)
it is then fine
Anyways... any easy way I can work arround so that I can just count the
number of records that has their last name = "Powell" down in my report?
Any suggestion is appreciated!
I am sorry that it may be an easy question for many of you people, but i
am kind of stuck here
Alec
I have a question about how to count the number or records in a report
my report runs a query on some tables and display the records on it.
in the report, it has a field [LastName], how can I count the number of
records that the [LastName] = "Powell" for example and display the
number of count in the report header?
I tried to make a function in VB for example
Public Static Function Total_Number_Last_name(ArrLastname() As Object)
Dim S As Integer
Dim R As Integer
Dim I As Integer
R = 0
For I = LBound(ArrLastname ) To UBound(ArrLastname )
If ArrLastname (I) <> "Powell" Then
Else
R = R + 1
End If
Next I
Total_Number_Last_Name= ArrRequestType
End Function
and call this function in one of the textbox in my report using
=Total_Number_Last_name([LastName])
However, I found that when I am calling this function from the report
heder, it does'nt seem recognize [LastName] as an array and give me
an "#error"
but if I change my function's argument type to (ArrLastname As Object)
it is then fine
Anyways... any easy way I can work arround so that I can just count the
number of records that has their last name = "Powell" down in my report?
Any suggestion is appreciated!
I am sorry that it may be an easy question for many of you people, but i
am kind of stuck here
Alec