View Full Version : Many to one relationships/record population?


Tommy B
09-04-2001, 02:55 AM
Hi Guys! Its a while since I had a post...life has been quite ;-) But that never lasts long at work does it!

So here is what I am trying to do:

I work in telcoms and need an automated system for provisioning new numbers. What I need is a two table system, the first table uses an autonumber ID, but needs to apply this ID to mulitple records in the second table...so if I have two number fields in the first table that act as a range i.e. 2000(first number field) and 3000(second number field), which the first table see as one record with one autonumber, and then have an append or make table query which will populate all numbers in the range as seperate records in the second table, but obviously using the master provisioning number against all. I know this sounds v.complex, and is probably not possible...but as always any manna from above would be gratefully recieved :-)

Cheers,

Tom.

Pat Hartman
09-04-2001, 06:13 AM
The primary key of your second table needs to be two columns. The MasterProvisioningNbr (which in the second table is defined as a long integer, not an autonumber) and a second column which could be an autonumber or a user defined number range.

If what you were actually asking for is code to generate a bunch of rows in the second table, post back.

Tommy B
09-04-2001, 07:36 AM
Yep. Its the code for autogenerating a range of numbers that I really need. Although the information you just gave is very useful too...thanks :-)

Would be great if you could help me out!!!

Tom.

Pat Hartman
09-04-2001, 01:06 PM
Sorry, I don't have any sample code. The following is psuedo code to outline the logic.

For I = 1 to MaxRows
AddNew
put values in fields
Update
Next I

Tommy B
09-05-2001, 12:19 AM
Thanks for this Pat...I will play around with the idea and see what happens http://www.access-programmers.co.uk/ubb/smile.gif

As always I greatly appreciate the help!

Tom.