paste append multiple copies

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How do I paste append multiple copies of a single record to its database in
Access 2003? For example, I buy 12 bottles of the same wine; how can I add 11
copies of the record without paste-appending them one at a time?
 
Dennis:

I'm not sure that you can. But an easy way to code it would be to write a
loop, and set a variable counter starting at one, running the loop until the
counter equals your quantity. Thus giving you 12 entries. I doubt you will
see much, if any, performance hit.

Good luck.

Sharkbyte
 
How do I paste append multiple copies of a single record to its database in
Access 2003? For example, I buy 12 bottles of the same wine; how can I add 11
copies of the record without paste-appending them one at a time?

One sneaky way to do this uses an auxiliary table. I routinely put a
table named Num, with one Long Integer field N, into each database I
build; I'll fill this with records from 0 through 10000 or so.

You can then run an Append query by including Num in the query; e.g.
if you're entering the data about the wine on a form, you could use a
query

INSERT INTO tblCellar
(Maker, Varietal, WineYear, ...)
SELECT Forms!WineEntry!txtMaker, Forms!WineEntry!txtVarietal,
Forms!WineEntry!txtYear, ...)
FROM Num
WHERE N < [Forms]![WineEntry]![txtNumberOfBottles];


John W. Vinson[MVP]
 
Many thanks for your suggestion. I will give it a try sometime but as you
suggest it will probably be quicker to stick to appending them one at a time.
 
Many thanks for your suggestion. I shall give it a try but, ss I have only 11
to add, it will probably be simpler to stick to adding them one at a time.

John Vinson said:
How do I paste append multiple copies of a single record to its database in
Access 2003? For example, I buy 12 bottles of the same wine; how can I add 11
copies of the record without paste-appending them one at a time?

One sneaky way to do this uses an auxiliary table. I routinely put a
table named Num, with one Long Integer field N, into each database I
build; I'll fill this with records from 0 through 10000 or so.

You can then run an Append query by including Num in the query; e.g.
if you're entering the data about the wine on a form, you could use a
query

INSERT INTO tblCellar
(Maker, Varietal, WineYear, ...)
SELECT Forms!WineEntry!txtMaker, Forms!WineEntry!txtVarietal,
Forms!WineEntry!txtYear, ...)
FROM Num
WHERE N < [Forms]![WineEntry]![txtNumberOfBottles];


John W. Vinson[MVP]
 

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

Back
Top