For the Record Source in a report i have built an SQL clause consisting of 2 parts:
StrUniversity and StrRating:
Me.RecordSource = StrUniversity & strRating
I get the values of the StrRating by the folowing code:
Dim StrRating As String
Select Case Forms![HighSchool]![Classroom]
Case 1
StrRating= “And ((Section.Number) 2)”
End Select
The code works fine provided that the conditions for the StrRating are written in the OnOpen event
of the report.If i try however to write a global function called Public function FncRatings(0
and then refer to it like that:
Me.RecordSource = StrUniversity & FncRating
then i receive no error but the function simply doesnt work, and the opened report does not differentiate between the ratings.
Obviously i cannot refer properly to the function FncRatin in the RecordSource of the Report.
Can somebody help me?