Hi there,
Can we use a function(written in modules) and Group by levels clause Simultaneoulsy in Building a report..
Will both of them work??
To be more clear i ll explain what i am doing?
I have a function
Public Function FixTitle(strTitle As String) As String
On Error Resume Next
Dim strOut As String
If UCase$(strTitle) Like "A *" Then
strOut = Mid$(strTitle, 3) & ", " & Left$(strTitle, 1)
ElseIf UCase$(strTitle) Like "AN *" Then
strOut = Mid$(strTitle, 4) & ", " & Left$(strTitle, 2)
ElseIf UCase$(strTitle) Like "THE *" Then
strOut = Mid$(strTitle, 5) & ", " & Left$(strTitle, 3)
ElseIf UCase$(strTitle) Like "B.*" Then
strOut = Replace(strTitle, ".", ""
Else
strOut = strTitle
End If
FixTitle = strOut
End Function
So, hope you have understood what this function does: it eliminates the Words 'A', 'AN', 'THE' in the Titles field
and returns the Remaining word..
So, now what i am trying to do while building a Report is Print the list of Titles which comes under one Subject So, i am using a Group By Levels clause(like to Group by Subject and then By Title) While Bulding this, i am able to build the Report but the Function is not working.
So, my question group by levels and Funtions will not work simultaneously.??
thanx for ur sujjestions,
Varun.
Can we use a function(written in modules) and Group by levels clause Simultaneoulsy in Building a report..
Will both of them work??
To be more clear i ll explain what i am doing?
I have a function
Public Function FixTitle(strTitle As String) As String
On Error Resume Next
Dim strOut As String
If UCase$(strTitle) Like "A *" Then
strOut = Mid$(strTitle, 3) & ", " & Left$(strTitle, 1)
ElseIf UCase$(strTitle) Like "AN *" Then
strOut = Mid$(strTitle, 4) & ", " & Left$(strTitle, 2)
ElseIf UCase$(strTitle) Like "THE *" Then
strOut = Mid$(strTitle, 5) & ", " & Left$(strTitle, 3)
ElseIf UCase$(strTitle) Like "B.*" Then
strOut = Replace(strTitle, ".", ""
Else
strOut = strTitle
End If
FixTitle = strOut
End Function
So, hope you have understood what this function does: it eliminates the Words 'A', 'AN', 'THE' in the Titles field
and returns the Remaining word..
So, now what i am trying to do while building a Report is Print the list of Titles which comes under one Subject So, i am using a Group By Levels clause(like to Group by Subject and then By Title) While Bulding this, i am able to build the Report but the Function is not working.
So, my question group by levels and Funtions will not work simultaneously.??
thanx for ur sujjestions,
Varun.