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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Numbering 2

Status
Not open for further replies.

Crauck

Programmer
Jul 26, 2002
24
US
I was looking for a way to take a Quantity field and create another field to eventually use as "Package": [new field]" of " [Quantity field].

For Example if my quantity is 10, The record will be repeated 10 times, so I need to have another field that will display a count starting with 1 and ending with what ever is in my Quantity field.
 
crauck,
There was a similar solution several weeks ago posted by CosmoKramer.
Add a new table to your database with one field, numbers. Populate the field with numbers from 1 to how many you need.
Create a query based on your table.
Add the numbers table to the query (don't relate the numbers table) and place the [numberfield] in the design grid. In the criteria section of the [numberfield] type "Between 1 and [Quantity field]"
when you open the query there will be as many entries for each product as are in the [quantity field]
jim
Tks Cosmo
 
I've been trying to get that to work as well. My situations requires just a little bit more. I'm working on it myself, but if anyone has any suggestions I would appreciate them.

What I have is something like. 10 lines records. Each record has its own quantity. Like:
Product Quantity
Chair 1
Table 5
Pencils 40
Apples 2
Toothbrush 6

So how do I get a line for each product based on its quantity?
The way that cosmo answered works great, but only for one line at a time.
 
Answer to my question(in case anyone else had the same question):

The cheap solution I have come up with was to create 15 queries. They filter out the quantity, and have the between 1 and SomeNumber where the SomeNumber is the same as the quantity. (i hope that was clear enough) This limits me to no more then 15 records (so quantities more then 15 won't get added in), but that would just force the user to enter it twice to get a quantity of 30. Not ideal, but i don't see any one using this system for more then a quantity of 15. If anyone has a more scalable solution I would appreciate it.
 
markphsd,
That is what Cosmo's solution does.
It gives:
item quantity Number
chair 1 1
table 5 1
table 5 2
table 5 3
table 5 4
table 5 5
pencil 40 1
pencil 40 2
pencil 40 3
. 4
. (from 4 to 39) (5 to 38)
. 39
pencil 40 40
apples 2 1
apples 2 2
... ... ...
jim
 
Xaf294


Oh really? I Think I must have looked at it wrong. What is the thread? I lost it, i was working from memory when I tried to set it up this week. I was suprised that i made it as far as i did. Well, I can find the thread myself i'm sure. Thanks for the info.
 
markphsd,
The thread is below, go to the 10th entry. Don't be intimidated by the length of one of the replies...
thread703-416348
jim
 
markphsd,
I am posting this a second time. The first one didn't get to the "top of the list." Don't know if it was accepted, or if you received a notification...
jim
--------------------
markphsd.
The thread is below, go to the 10th entry. Don't be intimidated by the length of one of the replies...
Thread703-416348
jim

 
Hey yeah, the thread. Actually i figured it out as soon as I read your previous post. Like I said, I was going off memory. That thread should be in the FAQ's. It's one of the simplest, but coolest pieces of infomration, and I see that question all over this site.

Thank you for find the thread though.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top