Null value issue in Criteria

L

Larry Hodges

A2002

I have two forms, the second referencing back to the first. On both forms,
I have a Long Integer field in the recordsets. In the criteria for the
second form, the data in that field has to match.

Of course it works fine if both have data. But if the field is null on both
forms, it doesn't.

I currently have this in the Criteria in the query:

=[Forms]![frmCustomerLumberTally]![BundleQuant]

So, how do I account for a null value?

Thanks in advance,
-Larry
 
T

Tom Ellison

Dear Larry:

It may be that, if the column value is NULL or if the control BundleQuant is
NULL, that you want to include the row in the query results.

In that case, the complete syntax is:

(SomeColumn = [Forms]![frmCustomerLumberTally]![BundleQuant]
OR [Forms]![frmCustomerLumberTally]![BundleQuant] IS NULL
OR SomeColumn IS NULL)

This above goes into the SQL View of the query in the place of your current:

SomeColumn = [Forms]![frmCustomerLumberTally]![BundleQuant]

Of course, SomeColumn is the name of your Long Integer column, which I do
not know.

Tom Ellison
 
L

Larry Hodges

Thanks Tom for the syntax. It worked great...I really appreciate the help!

-Larry


Tom Ellison said:
Dear Larry:

It may be that, if the column value is NULL or if the control BundleQuant
is NULL, that you want to include the row in the query results.

In that case, the complete syntax is:

(SomeColumn = [Forms]![frmCustomerLumberTally]![BundleQuant]
OR [Forms]![frmCustomerLumberTally]![BundleQuant] IS NULL
OR SomeColumn IS NULL)

This above goes into the SQL View of the query in the place of your
current:

SomeColumn = [Forms]![frmCustomerLumberTally]![BundleQuant]

Of course, SomeColumn is the name of your Long Integer column, which I do
not know.

Tom Ellison


Larry Hodges said:
A2002

I have two forms, the second referencing back to the first. On both
forms, I have a Long Integer field in the recordsets. In the criteria
for the second form, the data in that field has to match.

Of course it works fine if both have data. But if the field is null on
both forms, it doesn't.

I currently have this in the Criteria in the query:

=[Forms]![frmCustomerLumberTally]![BundleQuant]

So, how do I account for a null value?

Thanks in advance,
-Larry
 

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