Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

need help on duplicating record

Status
Not open for further replies.

pumkinjay

Technical User
Dec 19, 2001
9
GB
I Have a form and link to it is a table

| No | product | no of containers | Qty | U.O.M |
| 1 | orange | 2 | 25 | kg |
| 2 | bananas | 3 | 50 | kg |

What i want to do is run a push button so that the each record is multiplied by the number in "no of containers"

| No | product | no of containers | Qty | U.O.M |
| 1 | orange | 1 | 25 | kg |
| 1 | orange | 1 | 25 | kg |
| 2 | bananas | 1 | 50 | kg |
| 2 | bananas | 1 | 50 | kg |
| 2 | bananas | 1 | 50 | kg |

cany u help ??
 
Of course, there are ways to do what you want. Personally, I won’t do what I am about to show you. But, to answer your question...

In your push button,

Copy the record to a record array.
Delete the record.
For count = 1 To no of containers
Set no of containers in record array to 1
Write records from record array back to table
Endfor





 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top