query doesn't return new records

G

Guest

I have created some vba code that inserts new records into my db. However,
even though a record exists in all tables for the new id and all other
criteria are met for being selected by the query, the new records are not
selected.
This is access 2003. We have seven tables all joined on id. The code adds
the records to all the tables. I've created a new query and it gets the same
results. The new records are not selected.

TIA,
 
G

Guest

When having problems with a query not returning expected records, simplify it
until you see them.

I'm assuming that you double, no triple, checked the data and it's going
into the correct tables in the correct backend database file if split......

First start removing criteria. Remove one at a time if there are many in an
AND or OR in the WHERE clause then run the query.

Next try changing some of the INNER JOINS to LEFT or RIGHT JOINS one table
at a time then run the query.

After that try removing a table at a time.
 
G

Guest

Thanks Jerry. We found that because our query was eliminating any records
with any of five fields that were not null, this new record was being
excluded. Which means I am on to that next mystery- why does this new record
have five fields that appear and should be null but they actually aren't? The
record was created with VBA code... variables were initialized... and I used
this statement sINTERNAL_REMOVE_REASON = IIf(IsNull(rst4(15)), "", rst4(15))
in case the value coming from rst4 IsNull...
That part is still a mystery.
 
G

Guest

"" isn't null. It's an empty string which is a different thing. If you
want it to be null, replace "" with Null . No quotes needed.
 

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