
How can I copy records like cut-n-paste
Hi,
Will make a "driver" table ( John Viescas' definition ) with a single field
with the records values: 1, 2, 3, 4, .......... n
Will bring both tables into the QBE grid. Don't join anyhow those two tables
together, just bring the driver field into the grid, add a criteria to it:
<= [InitialTable].[RequiredQty]
Bring the other desired fields in the grid.
Run the query.
Why? Without any JOIN, even implicitly through the WHERE clause, you will
get each record or the initial table exactly n times (test in removing the
criteria). The implicit join through the WHERE clause limit those records
accordingly to the imposed condition. Simple, isn't it? (Note the WHERE
clause is, in fact, a JOIN since the condition spans two tables). Note: It
is not suggested to use implicit join through WHERE clause when it is
possible to do it through a simple JOIN, at least, in Access.
Hope it may help,
Vanderghast, Access MVP.
Quote:
>Hi:
>I want to be able to pick a record and make many duplicates of it. I know
>that my primary key field(s) will not be able to be duplicated. For that,
>I want to stop when the record is about to be added so that I can change
>the primary key to avoid duplication. Then I want to copy the rest of the
>record and keep on going, stopping everytime before adding a new record and
>giving me the chance to change the primary key to avoid duplication. Can
>something like be done? My record is quite a big one, containing
>approximately 50 text fields etc.
>Can this can be done? Should I do it in DAO using GetRow method of
>recordset or something like that. Essentially need a good way of providing
>"cut and paste" like feature so that the users can create similar records
>quickly by just changing the primary key values.
>Thanx
>--
>Asim K. Shafi