[AccessD] Create Multiple records in report

David Emerson newsgrps at dalyn.co.nz
Tue Dec 11 00:52:37 CST 2012


Thanks Stuart.  That is the solution I saw most often on the web but was
hoping that there was something simplier with just using the data in the
existing table.

I can't think how it could be done but then it is always dangerous to set
oneself as the limit of all knowledge.

Regards

David

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan
Sent: Tuesday, 11 December 2012 3:46 p.m.
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Create Multiple records in report

My standard solution for this is a numbers table.  (There are lots of uses
for one).

It just contains  single field "Num" and is  populated with a range of
numbers from 1 to 1000 or whatever is appropriate.


Then your query would be 

Select * from tblOrderItems, tblNumbers where tblNumbers.Num <=
tblOrderItems.Qty"

IIf tblOrderItems contains
OrderId   Item    Qty
1             1            3
1             2            2

Your recordset would return

OrderID  Item  Qty   Num
1              1       3        1
1              1       3        2
1              1       3        3
1              2       2        1
1              2       2        2

-- 
Stuart

On 11 Dec 2012 at 14:54, David Emerson wrote:

> This is not a direct Access question but more a SQL problem.
> 
>  
> 
> I have a table that has order addresses and number of items ordered.  I
want
> to create a label for each item shipped.  If I have an order for 3 widgets
> then I want 3 labels.  Is there a simple way of creating a record set with
> the number of records equalling the number of items shipped (and not the
> number of orders)?
> 
>  
> 
> Regards
> 
> David Emerson
> Dalyn Software Ltd
> Wellington, New Zealand
> 
>  
> 
>  
> 
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> 


-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com



More information about the AccessD mailing list