Search Form

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • wisni1rr
    New Member
    • Nov 2011
    • 78

    Search Form

    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:
    Code:
    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!
  • NeoPa
    Recognized Expert Moderator MVP
    • Oct 2006
    • 32634

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

    Comment

    • wisni1rr
      New Member
      • Nov 2011
      • 78

      #3
      Solved!!!

      Thanks bunches, NeoPa!

      Comment

      • NeoPa
        Recognized Expert Moderator MVP
        • Oct 2006
        • 32634

        #4
        Always pleased to help :-)

        Comment

        Working...