Prompt for the number of times to duplicate current record

K

Krispy

I want to have a button on my form that will ask you how many times to copy
the current record and then copy that many times.

I cannot find anything on this. Can someone please help me?
 
J

Jeff Boyce

Why? I'm not asking to be snoopy, but because a well-normalized relational
database may not need duplicate records.

Can you describe a bit more about the business need you feel this approach
(duplicate records) will help you solve?

Regards

Jeff Boyce
Micosoft Office/Access MVP
 
O

Ofer Cohen

Not sure what you mean by copying the records, but to create a loop try:

Dim Response As Integer, I As Integer
Response = InputBox("Please select a number")
For I = 1 To Response
' The process in the loop
Next I
 
K

Krispy

My form is for collecting measurement data of cut widths. There might be 55
cuts at 1.25" and 10 at 2.5". I have a drop down field where the user can
select the size they are measuring. If there are 55 of the same, being able
to duplicate a record of that size will eliminates the need to select from
the drop down for each one.
 
K

Krispy

Thank you for the help, but it didn't work. I put it in the "on click" of the
button. It is in a subform if that makes a difference.
Here is why I need this.
My form is for collecting measurement data of cut widths. There might be 55
cuts at 1.25" and 10 at 2.5". I have a drop down field where the user can
select the size they are measuring. If there are 55 of the same, being able
to duplicate a record of that size will eliminates the need to select from
the drop down for each one.
 
K

Krispy

There are no standard sizes. If varies from order to order.
I appreciate your response, but I really need to do just what I am asking
for. I need a way to copy the current record (with the exception of the key
field) as many times as I respond in a prompt.
 
K

Krispy

I should have said that it did work somewhat. The prompt box comes up asking
for a qty, but after you enter it, it doesnt add the records into the subform
 
K

Krispy

I'm sorry. It does work. Wahooo!

I had to add to put in the copy record code where you said " 'process to
loop" (dahhh!).

Thank you very much!
 
Top