Like query from text box on form

  • Thread starter Thread starter Francis
  • Start date Start date
F

Francis

Thanks,

I tried the - Like "*" & [Forms]![frmContact]!
[txtCompany] & "*" - and also used the Nz because I have
some records that are empty in either the company or
contact name fields. Even with the Nz the empty records
are not returned.

Could you shed any light?

Francis
 
You would need to either convert the null in the Field row ie: [Company] &
""
or add " or Is Null" to the criteria.
 
Thanks,

I tried the - Like "*" & [Forms]![frmContact]!
[txtCompany] & "*" - and also used the Nz because I have
some records that are empty in either the company or
contact name fields. Even with the Nz the empty records
are not returned.

Could you shed any light?

Francis

Try

LIKE "*" & [Forms]![frmContact]![txtCompany] & "*" OR ([Company] IS
NULL AND [Forms]![frmContact]![txtCompany] IS NULL)

as a criterion. NULL is not "like" anything, and will not be found
unless you use the IS NULL operation.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top