Strange query behavior

D

Dale Fye

I'm running into a strange problem with an Access 2K
query.

The query I'm running essentially does a comparision
between two tables with the same structure to identify
records as being in Table A only, Table B only, or in both
tables with differences in data. It does this by UNIONing
three subqueries (one for each criteria), and seems to be
working properly.

However, when I write code to dump the results of this
query into a temporary table, it doesn't return the same
result set as when I run the query. When the query is run
by itself, it might return 2 or 3 records, but when run
using the code below, it might generate 20 or 30 records.
When I look at the tables, the extra records in the
temporary table fall into the "in both tables with no data
differences" category, but they are not the only records
that fall into that category. Has anyone else run into
this problem before?

if TableExists("tbl_New") then
docmd.deleteobj acTable, "tbl_new "
endif
strSOL = "SELECT * INTO tbl_New FROM qry_my_query"
currentd.execute strsql
 

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

Similar Threads


Top