473,573 Members | 2,781 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

filter with form--test for null date

I have a shortdate text box (MyDate) that I want to filter by testing
for a null value, but:

Me.Filter = "MyDate = Is Null"
Me.FitlerOn = True

does not work. I also tried a null string ("MyDate = ''") and paired
delimiters ("MyDate = ##") but can't get it to work. I assume it has
something to do with the date format. Any hints?

thanks

Nov 13 '05 #1
4 10976
mhod...@comcast .net wrote:
I have a shortdate text box (MyDate) that I want to filter by testing
for a null value, but:

Me.Filter = "MyDate = Is Null"
Me.FitlerOn = True

does not work. I also tried a null string ("MyDate = ''") and paired
delimiters ("MyDate = ##") but can't get it to work. I assume it has
something to do with the date format. Any hints?

thanks


Try:

Me.Filter = "MyDate Is Null"

James A. Fortune

58% of teenagers believe they will become wealthy. The two main
avenues for attaining that wealth are envisioned to be 1) winning the
lottery 2) winning a tort
-- NPR radio

Nov 13 '05 #2
Thanks...worked fine. How would one have known that?

Nov 13 '05 #3
mhod...@comcast .net wrote:
Thanks...worked fine. How would one have known that?


The setting or return value is a String data type that contains the
WHERE clause of an SQL statement without the reserved word WHERE. --
A97 Filter Property Help

Try this experiment:

Create a new query. Select a table. Select a field. Put Null as the
Criteria. Look at the SQL view. Note: If you take off the parentheses
it will still run correctly.

James A. Fortune

Nov 13 '05 #4
Try:

If Me.Filter = IsNull([MyDate]) Then
Me.FitlerOn = True
Else
Me.FilterOn = False
End If

-Ed

<mh*****@comcas t.net> wrote in message
news:11******** *************@f 14g2000cwb.goog legroups.com...
I have a shortdate text box (MyDate) that I want to filter by testing
for a null value, but:

Me.Filter = "MyDate = Is Null"
Me.FitlerOn = True

does not work. I also tried a null string ("MyDate = ''") and paired
delimiters ("MyDate = ##") but can't get it to work. I assume it has
something to do with the date format. Any hints?

thanks

Nov 13 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
10076
by: evolve | last post by:
why doesn't c# seem to support some kind of 'null date' for instance: i have an application where the user is not obliged to enter a date until an event happens (e.g. a bug was fixed on xyz) the calendar control in asp.net doesn't seem to have a selectedDate = null property
1
6571
by: Vern | last post by:
I'm using the Microsoft Enterprise Data Access block to call the stored procedure. One of the values the stored procedure returns is the stop date. When the stop date is null, the program crashes. I would like to be able to test for a null date, and then store the mindate value in the class property. I've tried the following, but it...
6
12984
by: Dean Slindee | last post by:
I am looking for the "right" way to handle inserting and presenting null date values. Public Const c_NullDate As Date = #12:00:00 AM# If I set the value of a date variable in an SQL Server insert statement to c_NullDate, the insert statement works. When I re-read the row and display the inserted date value in a text box, the string...
1
4445
by: GB | last post by:
Is there a function to set a null date in vb.net? Normally, I create a const NULLDATE = "1/1/1900", but that becomes a drag at times. Especially, handling a nulldate from SQL into a dataset. Thank you, Gary
10
7636
by: Brad | last post by:
If I need to assign a NULL value to a date variable, how would I go about doing that? For right now I am using 01-01-2001, however I don't want to use a "real" date if the date should really be NULL. Thanks for the information.
6
8353
by: fonzie | last post by:
Is there any way to include two unbound text boxes (for a start date and end date) to a filter-by-form? The users may want to filter by several different fields and they may want to include a date range search on the one date field. Instead of having the users type in
0
1246
by: Ronald S. Cook | last post by:
When I pass a null date from my client to my service project, it comes across as #12:00:00 AM#. While I can easily code for this, it seems like a hack. Is this normal? I'm using WCF, by the way. Thanks, Ron
1
1610
by: klove1209 | last post by:
Good afternoon, I am currently working on this unbounded form that has numerous date fields. I wanted to know if it is possible to save data in a form, with a null date field. I am currently getting an error, and would like to know if there is a way around it. I am doing this feature just in case users do not need to enter a date for a...
5
15680
by: ahd2008 | last post by:
I have a form that pop up on the sessions form. i use the below code to filter the sessions form by the strat date of the course but it seems it is not giving any result. I get only empty fields Private Sub Toggle10_Click() !.Filter = "sessions.=" & StartDate !.FilterOn = True End Sub is there any problme with this code? Please adivse
1
2791
by: mwittekiend | last post by:
I am trying to convert a NULL date to a Y/N flag. It is giving me a conversion error. Here is the code. Any help is appreciated. Thanks 'CommitDateTimeFlag' = (case when CommitDateTime IS NULL then 'Y' else 'N' end)
0
7750
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7989
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8182
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
6369
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5559
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5271
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3708
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3708
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1008
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.