Re: First append query



Further to my earlier post I have a suspicion that the problem might be
caused by an attempt to duplicate the value of the primary key field when
the entire record is being duplicated, when really I just want it to create
a new unique autonumber in that field for each new record. If that is
indeed the cause I still do not know how to solve it, so question stands,
I'm afraid


"Jack ***" <mind-the-gap@xxxxxxxxxxxxxxxxxxxx> wrote in message
news:ugv7j5p8FHA.3224@xxxxxxxxxxxxxxxxxxxxxxx
> Hi all - Access 97
>
> Rather late in the day I have discovered (not surprisingly) a flaw in the
> table design of my first database (probably not the only one!)
>
> There is a table T_Tasks that tracks the progress of tax returns and
> preparation of accounts, with autonumber primary key ID_Tasks.
>
> Given that I would have to complete a tax return for each set of accounts
> I initially and erroneously figured that it would be sensible to use just
> the one record to track the progress of both.
> That assumption is flawed because more than one set of accounts might be
> relevant to one tax return, one set of accounts might be relevant to more
> than one tax return, and indeed some tax returns will not require any
> accounts (although that is only a minor objection).
> So I have decided to use a field "Task" to distinguish the tasks between
> accounts and tax returns (and indeed certain other tasks), and use query
> tables to match up accounts relevant to particular tax returns and monitor
> progress.
> The first step in this exercise will be to duplicate a large number of
> records currently residing in T_Tasks, append those records to T_Tasks,
> and then assign the Task_Type field of the new records to be "Accounts",
> leaving the original records dedicated solely to "Returns". There is
> already a Yes/No field "Accounts required?" within T_Tasks, and I tried to
> set up an append query that would create additional records in T_Tasks, as
> follows:
>
> INSERT INTO T_Tasks ( [Accs Req'd] )
> SELECT T_Tasks.[Accs Req'd]
> FROM T_Tasks
> WHERE (((T_Tasks.[Accs Req'd])=Yes));
>
> This bombed out with 0 records out of 808 appended, and error message that
> there were 808 validation rule violations. I clicked on Help at this
> point but I didn't understand the outcome, so it is back to the well of
> knowledge, I'm afraid. It did not help if I selected all of the fields in
> design view and left the criteria unchanged - same error.
>
> What next? ideas?
>
>


.