In the OnOpen event of the report i have a string strSize which i define each time for each report
for example:
Select Case Forms![Form1]![Pack]
Case 1
strSize = “And ((products.size) 0.4)”
End Select
Reports(StrReportName).RecordSource = strBas & strSize
I want to build a specilal global function to call every time i use the strSize.
For example i tried to use a function
Public Function GetSize() As String
Dim strSize As String
Select Case Forms![FBenchmark]![Gebinde]
Case 1
strSize = ” And ((products.size) = 0.4)”
End Select
GetSize = strSize
End Function
But how can i replace it in the code?
May be strSize = GetSize, but it fails
So my question is how can i replace the StrSize with e globlal code and not to write it each time in the following line:
Reports(StrReportName).RecordSource = strBas & strSize
Thank you in advance