Set Variable [$Estate ; Value: YourTable::Estate Reference Code]// If this is a global field you don't need the variable here
Set Variable [$i ; $I + 1]
Set Field [YourTable::Estate Reference Code ; $Estate & $I ]
Exit Loop If [$I >YourTable::Number of Apts ] //I'd make Number of Apts a global field as it doesn't apply to any one record in your table.
PS. you are likely to need a related table where you have one record for each estate related to this table where you have one record for each apartment.
Thanks for this. While it is a little over my head i have sort of tweaked it so that the new records go onto a new table.
Can we also get the script to copy the other data into each new record it creates? such as the Estate Name etc?
You could, but that would be redundant and denormalizes your data. (The same data is now stored in two different fields. Not only does this take up storage space where you don't need to, if you ever have to update that data, you have to update it in multiple records in exactly the same way.)
I'd just keep the Estate Name in a separate table where you have one record for each estate and then link it via a relationship via the Estate Reference code.
You can display any data specific to that apartment's estate vial the relationship so that you don't have to enter and maintain multiple copies of the same information for every individual apartment record.
I am trying to do the same thing with my database- create a certain number of new records by script according to the number I typed in.
I have been trying to understand the instructions and tweak it so that it works with mine.
I am just wondering for "Set Variable [$i ; $I + 1]" What does the $i and $1 refer to as I don't really see those fields...
Those are not fields. They are variables.
Ps. This thread is over a year old and no longer pops up in Recent Items when a message is posted to it. I am likely to miss any follow on posts that you make. You may want to start a new thread with your questions.