469,150 Members | 1,942 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,150 developers. It's quick & easy.

Criteria to include fields with NULL DATA

106 100+
Hi,

in the underlying query of a form and to the field 'manu_number', I have added the criteria,
Expand|Select|Wrap|Line Numbers
  1.  Like "*" & [Forms]![FindCartridge]![cmbManu] & "*" 
this lists all records on startup, except, if manu_number field is blank or null or no data, whence it is excluded.

how can include fields with no data.
Mar 8 '10 #1
4 2006
TheSmileyCoder
2,321 Expert Mod 2GB
Expand|Select|Wrap|Line Numbers
  1. Like "*" & [Forms]![FindCartridge]![cmbManu] & "*"  Or Is Null
Mar 8 '10 #2
tasawer
106 100+
Thanks for your reply.
This solution brings all records at startup (as I wanted).
However, once I make a selection in combo box, The Selection + all null values are listed :)
Mar 8 '10 #3
TheSmileyCoder
2,321 Expert Mod 2GB
Try this
Expand|Select|Wrap|Line Numbers
  1. Like "*" & nz([Forms]![frm_Main]![cmb_Test],"") & "*";
The nz function will check if the first argument is null, and if it is, will return the second argument (""). If it is not null, it will return the first argument.

That said, im wondering a bit why you even need a "fuzzy" match and using "Like", is there not a primary key you could use instead?
Mar 8 '10 #4
tasawer
106 100+
Hi SmileyOne,

Thanks for the suggetions, you made me smile. :) :) :)

I used the primary key method.

my query is a complex one and I was thinking on the same lines, just assuming that this is also a complex solution.

Thanks
Mar 9 '10 #5

Post your reply

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

Similar topics

8 posts views Thread by Steve Jorgensen | last post: by
2 posts views Thread by Mark Roughton | last post: by
reply views Thread by zhoujie | last post: by
1 post views Thread by Mortomer39 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.