By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,504 Members | 1,584 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,504 IT Pros & Developers. It's quick & easy.

Criteria to include fields with NULL DATA

100+
P: 106
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
Share this Question
Share on Google+
4 Replies


TheSmileyCoder
Expert Mod 100+
P: 2,321
Expand|Select|Wrap|Line Numbers
  1. Like "*" & [Forms]![FindCartridge]![cmbManu] & "*"  Or Is Null
Mar 8 '10 #2

100+
P: 106
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
Expert Mod 100+
P: 2,321
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

100+
P: 106
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.