How to get Null and IS NULL combine (Third Condition/All Data) (1 Viewer)

Muaz

Registered User.
Local time
Today, 06:34
Joined
Dec 20, 2013
Messages
50
Hi All;

I am using a frame on form to get report. Below is the code used to filter report.

Select Case Me.fraReportType.Value
Case 1
strReportType = "Like '*'"
Case 2
strReportType = " Is Null"
Case 3
strReportType = " Is Not Null"
End Select


The second and Third case is working fine. While the first condition is not working. This filter is on date field.

There are three possibilities:

1. If we need all data
2. If we need is null data
3. If we need is not null data

How I can get the first condition using my code mentioned above.

Any suggestion will be highly appreciated.

Best Regards
Muaz
 

CJ_London

Super Moderator
Staff member
Local time
Today, 14:34
Joined
Feb 19, 2013
Messages
16,604
may be as simple as you are missing a space before Like
 

plog

Banishment Pending
Local time
Today, 08:34
Joined
May 11, 2011
Messages
11,643
If you need all data, don't apply a filter.

The problem with the first case where you set strReportType is probably that you don't have a space preceding it. The 2 cases that work do.
 

MSAccessRookie

AWF VIP
Local time
Today, 09:34
Joined
May 2, 2008
Messages
3,428
Since the general purpose of a Filter is to Exclude items that do not fit the desired criteria, and the first entry represents all items, It is difficult to see why a filter would be needed. Try using no Filter and see if it does what you want.

Beaten by two! and I even looked before I started to post :banghead:
 

Users who are viewing this thread

Top Bottom