Key Violation, No Primary Key

G

Guest

Hi,

My append query will not append ALL of my records, due to key violations. I
had a multi-field primary, but during experimenting, I took it off. I STILL
get key violations for all 10,526 records, and all of my indexed fields allow
duplicates. What else could it be?

Thanks!
 
G

Guest

Okay,
a BIG DUH!!

I had emptied my customers table, which has a primary key for the table I
was trying to update. I emptied it during testing and Didn't remember! Boy
am I a dummy.

BUT , I have one more question.

When I do an append query to add new records that do not match ones in the
current table, like this:

INSERT INTO tFit ( style_pk )
SELECT DISTINCT N.style
FROM tFit AS F RIGHT JOIN tFresh AS N ON F.style_pk=N.style
WHERE (((F.style_pk) Is Null));

It never fails that the query will tell me it can't append 1 record, and
when I go in to view the append query, it is always a completely null record,
of which I KNOW there are no real null records in the tables I am appending
from. It happens every time.

Why is that caused? How can I stop it?

THANK YOU!
 
G

Gary Walter

:
When I do an append query to add new records that do not match ones in the
current table, like this:

INSERT INTO tFit ( style_pk )
SELECT DISTINCT N.style
FROM tFit AS F RIGHT JOIN tFresh AS N ON F.style_pk=N.style
WHERE (((F.style_pk) Is Null));

It never fails that the query will tell me it can't append 1 record, and
when I go in to view the append query, it is always a completely null
record,
of which I KNOW there are no real null records in the tables I am
appending
from. It happens every time.
I don't know, but could you verify that
following query returns no records?

SELECT * FROM tFresh As N
WHERE Len(Trim(N.Style & "")) = 0;

this would catch null plus those that
"look like" null, i.e., zero-length strings
and just SPACE(s).
 
G

Gary Walter

sounds like you have "Output all fields"
checked in

Tools/Options/Tables/Queries

I could be mistaken....
 
V

Van T. Dinh

Sound to me that they are both "New Record" rows.

The only difference is that if the Focus is on this row, it becomes an
"edit" row with the right-pointing arrowhead on the on the RecordSelector.
For a "New Record" row without the focus, the asterisk is shown on the
Record Selector.
 

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