472,122 Members | 1,452 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

Criteria to include fields with NULL DATA

106 100+

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 2139
2,322 Expert Mod 2GB
Expand|Select|Wrap|Line Numbers
  1. Like "*" & [Forms]![FindCartridge]![cmbManu] & "*"  Or Is Null
Mar 8 '10 #2
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
2,322 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
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.

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 leo001 | last post: by

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.