Generating records

jtamaro

New member
Local time
Today, 11:49
Joined
Oct 30, 2003
Messages
5
Hi,

My questions is how to generate records to a new table.

My input is an inventory table.

I want to generate a record for each item in stock.

For example, ItemA has 4 items in stock, ItemB has 13.

I want to generate a new table with 4 records for ItemA and 13 for ItemB.

This table will then be used for printing barcode labels.

Thank you.
John Tamaro
 
I don't exactly understand the problem here. Is the data already somewhere in the database? Or is the item info already in there, but the in stock info not?
 
Generating Records

Sorry for the lack of information.

Yes, there is an input table, tblInventory as follows:

Item_Description Quantity Price
-------------------------------------------

ItemA 4 $1.25
ItemB 13 $0.75



I would like to generate an output table: tblTemp with 13 records:

Item_Description Price
-----------------------------------

ItemA $1.25
ItemA $1.25
ItemA $1.25
ItemA $1.25
ItemB $0.75
(repeat Item B 12 more times)

The quantity in the output table is not important.

As I mentioned, the tblTemp will then be used to print barcoded labels.
 
Last edited:
The only way I can think of doing this is using DAO (or ADO) along with VBA to generate the temp table using code. I'd implement a simple loop to check the quantity, the write the item and price that number of times to the temp table.
 
DAO

I'm sure that writing code will work but I have the slightest idea on how to do it.

I don't know what a DAO is. Can you point me in the direction of where I can get help on this topic?
 
Label Printing

Pat,

I can see how that can work. I don't know Basic very well so check me if I'm wrong but it looks like I would have to put the "Quantity" from each record into the "CopyCount&" variable and then execute a loop until CopyCount& = 0.

John
 

Users who are viewing this thread

Back
Top Bottom