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

Search Form

P: 78
Hello,

I have a form named [Search] it has several unbound textboxes with the name property set to this method[qfield] each textbox default value is "".

I have a button that will open a report once clicked. The report RecordSource is a query [qrySearch].

The query has several fields each with this Criteria:
Expand|Select|Wrap|Line Numbers
  1. Like [Forms]![Search].[qfield] & "*"[
My problem is if a value in a record is null, it does not return in my search. I need it to return records with nulls as long as all the other requirements are met.

How do I have my query include records with null values if no other criteria is set?

Thanks for any help/advice you can provide!
Nov 30 '11 #1

✓ answered by NeoPa

It doesn't help that you left out the field name from your example, but essentially you can use :
Expand|Select|Wrap|Line Numbers
  1. Nz([FieldName], '') Like [Forms]![Search]![QField] & '*'
PS. Dot (.) references are not recognised in SQL, or by inference, filters etc (which are also SQL).

Share this Question
Share on Google+
3 Replies


NeoPa
Expert Mod 15k+
P: 31,707
It doesn't help that you left out the field name from your example, but essentially you can use :
Expand|Select|Wrap|Line Numbers
  1. Nz([FieldName], '') Like [Forms]![Search]![QField] & '*'
PS. Dot (.) references are not recognised in SQL, or by inference, filters etc (which are also SQL).
Nov 30 '11 #2

P: 78
Solved!!!

Thanks bunches, NeoPa!
Dec 1 '11 #3

NeoPa
Expert Mod 15k+
P: 31,707
Always pleased to help :-)
Dec 1 '11 #4

Post your reply

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