Re: Figuring out what field is causing key violation on append
- From: "Jeanette Cunningham" <nnn@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 24 Feb 2009 06:52:20 +1100
You can use Nz([MyField1],"")
Nz converts nulls to whatever you put as the second argument.
Check VBA help on the Nz function.
Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
"JN" <me@xxxxxxxx> wrote in message
news:eY9xC3dlJHA.3760@xxxxxxxxxxxxxxxxxxxxxxx
I figured out what was wrong. The vendor for some reason changed a lot of
the fields to not allow nulls any longer. What a PIA because there are
currently about 20 fields that are optional now. They appear to put "" in
the field in the program now.
OK, so I guess my most difficult choice is create an append query that
has:
=IIF(IsNull([MyField1]), "", [MyField1])
as the source. But this is for 20-30 fields so is there some way to
autoconvert nulls to "" for text types?
"Jeanette Cunningham" <nnn@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:efT2ZE$kJHA.2064@xxxxxxxxxxxxxxxxxxxxxxx
Hi JN,
You can use a process of elimination.
First try the query with just one field in the append query.
If that is successful, add one more field to the query.
You can also use Debug.Print to put the query string into the immediate
window.
By examining the string, you can often get an idea of what is wrong.
Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
"JN" <me@xxxxxxxx> wrote in message
news:uPJw7s9kJHA.1248@xxxxxxxxxxxxxxxxxxxxxxx
The problem is NO records append. Even when I just try to append a
single record it fails with the error show.
It is definetly not a restriction on adding records because I can copy a
record from the table to a new record (just changing the PK). It has to
be that one of the fields has some type of restriction that I just can
seem to find like no Nulls or Required or something I am just missing in
the 75 fields.
"KARL DEWEY" <KARLDEWEY@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:911B1DD7-1D62-4FA1-B33F-A255867F5638@xxxxxxxxxxxxxxxx
I would start by letting it append those that it will and then run an
unmatch
query to see what was not appended.
Use input table left join to new table with criteria for new table join
field as 'Is Null'.
First look for nulls.
Then duplicate records.
--
KARL DEWEY
Build a little - Test a little
"JN" wrote:
I have a new version of a program. It has pretty much the same table
design, except for a couple of extra fields and a few fields got an
increased in size.
I want to just copy my data from my old table into the table in the
new DB
(SQL 2000 back end) however when I do I get the error:
Microsoft Office Access can't append all the records in the append
query
Microsof Office set......and did not add XX records to the table due
to key
violations, .......(all other than key violations is 0)
This table has about 75 fields. A lot of them in the previous version
were
set to Required = No and other minor changes. It would take for every
to
find the right combination so is there a way when I run an append
query to
see what field(s) is causing the problem?
.
- References:
- Figuring out what field is causing key violation on append
- From: JN
- RE: Figuring out what field is causing key violation on append
- From: KARL DEWEY
- Re: Figuring out what field is causing key violation on append
- From: JN
- Re: Figuring out what field is causing key violation on append
- From: Jeanette Cunningham
- Re: Figuring out what field is causing key violation on append
- From: JN
- Figuring out what field is causing key violation on append
- Prev by Date: Re: running balance
- Next by Date: Access Append Query
- Previous by thread: Re: Figuring out what field is causing key violation on append
- Next by thread: is there such a thing as a fast pivot table? (CAN they by optimized???)
- Index(es):
Relevant Pages
|