PDA

View Full Version : Solved: Append Query: Unexpected Results



eed
09-28-2005, 10:49 AM
Hi, all,

I was running an Insert Into SQL command in a VBA event procedure, but it wasn't behaving the way I expected. To check my code, I built an append query and just inserted a value in place of the VBA field reference.

Funny thing is, the append query didn't behave as expected either. I told it to select a set of fields in TableA where FieldA=28, then append those records to TableB. The query previewed 6 records. I ran the query, then opened TableB to check the results. Only 3 records had been appended.

None of the records shared all identical values, so they could not be confused as duplicates. One of the values being copied is the autonumber Primary Key from TableA, which is copied into a number field in TableB (which has no primary key). They also had several other fields with different values.

I'm really lost here on the issue of: why would the append query preview 6 records to be appended and then only append 3? http://vbaexpress.com/forum/images/smilies/banghead.gif

I apologize in advance that I don't have a sample file to provide... if no one can suggest anything without seeing it, then I will attempt to create a dummy file with no proprietary structure/data so I can tack it on to a post...

Am I just missing something really stupid?? Thanks for any thoughts!!
~ eed

eed
09-28-2005, 11:07 AM
DOH!! Never mind!

My code had turned off warnings, but because I had been using a breakpoint to check something, I apparently never got warnings turned back on. Thus when I ran the append query, I was not receiving Access' lengthy and detailed explanation of why it wasn't appending my other 3 records.

I just KNEW I was missing something stupid. :doh:

~ eed