Null

  • Thread starter Gaetanm via AccessMonster.com
  • Start date
G

Gaetanm via AccessMonster.com

I have a parameter query which is the variables are put in via a form. The
Query is called
[Search_parts] the form name is [parts_status]

The variable fields are: [Part#], [PoductDescription],[Invoice_no].

If I put data in [productDescription] it will get that “like†variable that I
put there but
only if an [invoive_no] is associated with it. It disregards any records if
[Invoice_no] has a null.

I would like to get my “LIKEâ€[ProductDescrition] and my [Invoice_no]
regardless if
[invoice_No] has a null in it or not.

When I deleted the [invoice_no] field and ran my query I got all my “LIKEâ€
[ProductDescrition]

Any Ideas Folks

Here is my SQL
SELECT Parts.[Part#], Parts.ProductDescription, Suppliers.SupplierName, Parts.
Purchase_Date, Parts.Invoice_No, Parts.[Unit Price], Parts.[Mark Up], ([unit
price]*parts.[mark up])+[unit price] AS Sell_price, [Job Sheet].Notes, [Job
Sheet].Job_Number
FROM Suppliers INNER JOIN ((Customers INNER JOIN [Job Sheet] ON Customers.
CustomerID = [Job Sheet].CustomerID) INNER JOIN Parts ON [Job Sheet].[Job ID]
= Parts.[Job ID]) ON Suppliers.SupplierID = Parts.[Lookup Vendor]
WHERE (((Parts.[Part#]) Like "*" & [FORMS]![frm_Parts_Status]![part_number] &
"*") AND ((Parts.ProductDescription) Like "*" & [FORMS]![frm_Parts_Status]!
[productdescription] & "*") AND ((Parts.Invoice_No) Like "*" & [FORMS]!
[frm_Parts_Status]![invoice_number] & "*"));

Thanks
 
G

Guest

If you have criteria and the field is null the record will not be pulled as
null is not like anything.
Edit it like this --
AND (((Parts.Invoice_No) Like "*" &
[FORMS]![frm_Parts_Status]![invoice_number] & "*")) OR Parts.Invoice_No Is
Null);
 
G

Gaetanm via AccessMonster.com

Karl
Thanks for the quick reply

I tried what you suggested and it only pulls the Nulls.

I need is if I put a value in "LIKE"[product Description] return all the
[product description] that match the "Like" value regardless the
status of [Invoice_No] any suggestions?


KARL said:
If you have criteria and the field is null the record will not be pulled as
null is not like anything.
Edit it like this --
AND (((Parts.Invoice_No) Like "*" &
[FORMS]![frm_Parts_Status]![invoice_number] & "*")) OR Parts.Invoice_No Is
Null);
I have a parameter query which is the variables are put in via a form. The
Query is called
[quoted text clipped - 30 lines]
 
G

Guest

regardless the status of [Invoice_No] any suggestions?
What do you mean by STATUS of invoice? It should pull those that match the
invoice OR have no invoice number.

Do you not want nulls if you enter an invoice number?
--
KARL DEWEY
Build a little - Test a little

Gaetanm via AccessMonster.com said:
Karl
Thanks for the quick reply

I tried what you suggested and it only pulls the Nulls.

I need is if I put a value in "LIKE"[product Description] return all the
[product description] that match the "Like" value regardless the
status of [Invoice_No] any suggestions?


KARL said:
If you have criteria and the field is null the record will not be pulled as
null is not like anything.
Edit it like this --
AND (((Parts.Invoice_No) Like "*" &
[FORMS]![frm_Parts_Status]![invoice_number] & "*")) OR Parts.Invoice_No Is
Null);
I have a parameter query which is the variables are put in via a form. The
Query is called
[quoted text clipped - 30 lines]
 

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

Top