Help in creating output file from a table

Ste4en

Registered User.
Local time
Today, 12:09
Joined
Sep 19, 2001
Messages
142
Help in creating output file from a table PLEASE ITS EASY

I have the following info in a table - I am trying to make a file to import into a label printing program. I have qty 5 of item X13 and so need 5 labels for it, 3 of X24's and so on. The output is basically a print file that will print the right quantity of labels for each of the names equipment.

Name; number
X13; 5
X24; 3
X77; 1

I need an output file as follows, in excel or query result:


X13
X13
X13
X13
X13
X24
X24
X24
X77

How do i achieve this in a query or do I need code and if so what would it look like..

Thanks

Steve
 
Last edited:
Kludge !

I offfer a somewhat quirky solution !

Assuming you have a manageable "maximum" number of items....

Create a table (tblMultiplier, in my example) with one field 'number' and as many records as your maximum number of inventory items for any one Item Name.

e.g. tblMultiplier
Number
1
2
3
4
5

Then build a query using the following SQL

SELECT tblEquipment.name
FROM tblEquipment, tblMultiplier
WHERE (((tblMultiplier.Number)<=[tblEquipment]![number]))
ORDER BY tblEquipment.name;

By including the tblMultiplier (with no join) you will get as many multiples of each equipment name as there are records in tblMultiplier. By having sequential numbers for each record in tblMultiplier and limiting the output to [tblMultiplier]![Number]<=[tblEquipment]![number], you will get the multiple output desired.

Quirky, but it seems to works. Of course, someone else could probably offer a simpler, more correct and straight-forward solution :)
Regards

John
 
John, quirky but it works thanks.
Steve
 

Users who are viewing this thread

Back
Top Bottom