creating fields + records?

Milan

Registered User.
Local time
Today, 21:54
Joined
Feb 17, 2002
Messages
85
Hi People,

I have a table which has the following fields:

CreateFieldNm , startvalue, endvalue
TEST1 1 56
TEST2 57 120
TEST3 121 245

basically what needs to happend, is when user enter the createfield name , start and endvalues. the code will then go to a another table create a field name called TEST1 and will set the data type as a intger, and will create 56 records wich will start from 1 and will end 56. something like:

TEST1
1
2
3
4
so on.,.. to 56

it will then do the same for the next record, newfield, sametable as before, but newfield called TEST2 , and records from 57 to 120. and on to the next record.

My brain is telling me to use the tabledef object, using the createfield method?. Any ideas on how i can do the above?

Would really appreciate some help on this one please!


Thanks
 
Milan,

You should generally not store data that you
can calculate. I don't understand why just
because one of your records has an integer
range you must create a new table and fill
it with the components of the range.

I could understand it if you had a structure
like:

tblMain:
KeyName
StartValue
EndValue

tblDetails:
KeyName
RecordID (Within range specified by tblMain)
SomeOtherInfo

If you could elaborate more on what you are
trying to do, one of us here can help.

Wayne
 
Wayne,

I hear what you are saying !, but the reason i am storing numbers in a table like described is to then use that table as a lookup table. I have a table with equipment(boxes) that store different quantities of items. The quantities that can be loaded into each box depend on two conditions. The first condition is size of the unit, which is a parameter that is supplied when the product is setup. The second parameter is based on a position of location, to keep things simple i have called this second condition a sequence load, which is indicates a certain loading pattern to br used based on the sequence number so for example:

table-: equipment:

fields-: equipment name, no Max Quanitity SequenceLoad no
BOXSQUARE1 112 56 sqr56a
BOXSQUARE2 112 56 sqr56b
BOXSQUARE3 112 56 sqr56c


table-:loads
fields: No, sqr56a, sqr56b, sqr56c,
1 1 57 113
2 2 58 114
3 3 59 115
5 4 60 116
5 61 117
and so on to 500 56, "" 112 "" 168


so through vba code it will iterate through each equipment name,
and use the lookup table and assigns the correct quantity. so if no was 3 then in table equipment , BOXSQUARE1 , NO = 3, BOXSQUARE2, NO=59 and so on.
 

Users who are viewing this thread

Back
Top Bottom