473,394 Members | 1,694 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

How to test for a null value?

sueb
379 256MB
I realize that this is a really lame question, but here goes anyway. Why does the following line tell me that I "can't assign a value to that object"?

Me.Filter = "[Priority] > 0 and [Status] = Null and [In Bucket]"

These are fields in my database. "Priority" is an integer, "Status" is a small (3-character) text field, and "In Bucket" is a Yes/No field. Since I've been successful in other code in testing the values of both "Priority" and "In Bucket", I'm assuming the problem lies in trying to find records where "Status" is empty.
Oct 19 '10 #1

✓ answered by ADezii

Expand|Select|Wrap|Line Numbers
  1. Me.Filter = "[Priority] > 0 And IsNull([Status]) And [In Bucket]"
  2. Me.FilterOn = True

4 1731
ADezii
8,834 Expert 8TB
Expand|Select|Wrap|Line Numbers
  1. Me.Filter = "[Priority] > 0 And IsNull([Status]) And [In Bucket]"
  2. Me.FilterOn = True
Oct 19 '10 #2
sueb
379 256MB
Well, that worked, for as far as the snippet of code I posted, but there are actually 3 sets of data for which I have to do this same set of tests, so here is the whole line. I must have a symbol in the wrong place or something because I'm still getting that error once I include all the other fields.

Me.Filter = "([Priority] > 0 and IsNull([Status]) and [In Bucket]) or " & _
"([Priority (2)] > 0 and IsNull([Status (2)]) and [In Bucket (2)]) Or " & _
"([Priority (3)] > 0 and IsNull[Status (3)] and [In Bucket (3)])"
Oct 19 '10 #3
sueb
379 256MB
Oh, I think I see the missing parenthesis. Hang on, I'll fix that and try again.
Oct 19 '10 #4
sueb
379 256MB
Great! Once I included the missing parentheses it works perfectly. Thanks so much!
Oct 19 '10 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Mark | last post by:
Hi, If I have a DataView containing some items and what I want to do is restore a textbox with an item in one of the rows. If the item in the datarow is null then obviously I get an error when I...
4
by: Tom Esker | last post by:
I've got Javascript in a form that adds up all of the numbers in a column of form fields and displays a total. It works great if every field has an initial value of 0, but if any of them are null,...
7
by: Uwe Range | last post by:
Hi to all, just ran into a problem: I wrote a function which works with several values collected on a form. I thought it would be no problem, if the fields were empty, because I made the...
5
by: Jet | last post by:
Hi all, I had a code like the follow: class A{ ... public void get(int i,params OleDbParameter p) { if((p!=null)||(p.Length>0)) { // Do some work }
15
by: TC | last post by:
What does it mean for an integer to have a null value? I am trying to use the DataView.Find method. That method has an integer return type which contains the "index of the row in the DataView...
4
by: keithb | last post by:
What is the correct syntax to detect whether a DataTable Row.ItemArray element is a null value? using: if (row.ItemArray == null ) does not seem to work. Thanks,
3
by: Giorgio Parmeggiani | last post by:
HI I have a method that receive a generic parameter and also return a generic: public T GetById(ID id) I've want to return null if the received parameter is null, so i have write this code:...
3
by: Akhenaten | last post by:
I have the following function which works great except when I encounter a NULL value in my array ($aidlook) and then I get "wrong data type" errors. I thought about doing a NULL check and creating...
5
by: axapta | last post by:
Hi Group, How can I overcome the issue of null values in a datareader. I keep getting the dbnull error when I try to assign a null value to a text box. TIA
0
by: kishoramballi | last post by:
Hi, I have created table using following sql statement through psql tool in test database using create table t1(f1 int); table is created. Now I am using an odbc script to insert 5 records....
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.