Solved IF function for filtered data (1 Viewer)

Kayleigh

Member
Local time
Today, 08:58
Joined
Sep 24, 2020
Messages
706
Hi there,
In my report I have textbox which should display the filter which the report was opened on. I would like to apply an IF function so if the report is not opened with filter ie all records, it will display 'all'. How would do I code this?
Thanks again!
 

bob fitz

AWF VIP
Local time
Today, 08:58
Joined
May 23, 2011
Messages
4,717
In the reports On Load event:
Code:
    If Len(Me.Filter) > 0 Then
       Me.NameOfTextBox = Me.Filter
    Else
       Me.NameOfTextBox = "ALL"
    End If
Substitute NameOfTextBox with the actual name of your textbox control
 

Ranman256

Well-known member
Local time
Today, 04:58
Joined
Apr 9, 2015
Messages
4,339
if Isnull(Me.Filter) then

'but all filtering should be done outside the report.
on a form or query.
 

Kayleigh

Member
Local time
Today, 08:58
Joined
Sep 24, 2020
Messages
706
Great I used that code with some tweaks!
Thanks
 

Users who are viewing this thread

Top Bottom