Unmatched Query always returning 1 blank result?

D

DaveKristof

[MS Access 2000]
I have two tables with a linked primary key. I am using an Unmatched
Query to find all the results in one table that do not appear in the
other table based on the primary key. So when the two tables are
identical, the query should return 0 rows, and when there are extra
rows in the first table, the extra ones should all return as results.
So everything works fine when there are new rows, but the problem
occurs when the tables are the same. It should return 0 rows, but it
actually returns 1 blank row!
In my code, I am checking to see if there are any new entries or if
there are no new entries. The easiest way to do this is to check the
row count of the unmatched query. If it's >0, there are new entries,
if it's 0 there are no new entries. But that one blank row always
shows up even when there are no new entries! So essentially 0 new
entries always looks the same as 1 new entry!

I have tried setting the query criteria to "Is Not Null" and it still
returns these null values.
I have tried creating a second query that just draws information from
this one and it still returns the 1 blank row. I have also tried
adding the criteria "Is Not Null" to this query, and it still returns
the blank row.

Is there some way to get rid of this blank row?
Or is there an easy way (in code) to check the value of the first
result in a query to see if it is null like the DCount for finding row
count?
 
G

Guest

It's not record at all. Rather it's there to let you type in a new record.

How to make it unupdateable and get rid of the extra row? One way is to
bring down the a table on the left side of the join twice into the QBE grid.
It will have the same name with an _1 at the end. Link these two tables
together by their primary key. Now you won't see the extra line.
 
D

DaveKristof

My other queries do not contain this extra row. If I wanted to add an
extra row, I could hit the button at the bottm that adds one. All my
other queries do not contain this blank row and they return 0 when you
check the rowcount. I think it might have something to do with
unmatched queries, because my select queries do not have this problem.

Also I forgot to mention above: I have multiple queries of this type
that find new rows in multiple tables, so for a form checking the
first field in the first row, I can not just set the form's source to
one table because I need to check numerous tables. DCount allows you
to check any table you want without it being the linked source.

It's not record at all. Rather it's there to let you type in a new record.

How to make it unupdateable and get rid of the extra row? One way is to
bring down the a table on the left side of the join twice into the QBE grid.
It will have the same name with an _1 at the end. Link these two tables
together by their primary key. Now you won't see the extra line.
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.



[MS Access 2000]
I have two tables with a linked primary key. I am using an Unmatched
Query to find all the results in one table that do not appear in the
other table based on the primary key. So when the two tables are
identical, the query should return 0 rows, and when there are extra
rows in the first table, the extra ones should all return as results.
So everything works fine when there are new rows, but the problem
occurs when the tables are the same. It should return 0 rows, but it
actually returns 1 blank row!
In my code, I am checking to see if there are any new entries or if
there are no new entries. The easiest way to do this is to check the
row count of the unmatched query. If it's >0, there are new entries,
if it's 0 there are no new entries. But that one blank row always
shows up even when there are no new entries! So essentially 0 new
entries always looks the same as 1 new entry!
I have tried setting the query criteria to "Is Not Null" and it still
returns these null values.
I have tried creating a second query that just draws information from
this one and it still returns the 1 blank row. I have also tried
adding the criteria "Is Not Null" to this query, and it still returns
the blank row.
Is there some way to get rid of this blank row?
Or is there an easy way (in code) to check the value of the first
result in a query to see if it is null like the DCount for finding row
count?- Hide quoted text -

- Show quoted text -
 

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