This topic is locked
[SOLVED]

 Automatic record insert

9/6/2012 3:45:40 PM
ASPRunnerPro General questions
H
hsan author

I would really appreciate help on this. I have table "Orders" with one of the fields called "Qty". Key is on "OrderNumber". "Qty" is number of identical components to be processed, let's call it "n". In the child table, I would like to do following (add page):

  1. Automatically create "n" new records based on "Qty" field value (number of components to be processed)
  2. Populate a field "LIneItem" in each created record with appropriate "n" value (i.e. 1 of 3, 2 of 3, 3 of 3 etc).
    Thanks in advance

G
gdmacdo 9/7/2012

You could place something like this in the "After record added" event. I wanted to record in a table (Last_Action) who was last to modify, when, modified and for what studentID :

set dal_table=dal.Table("Last_Action")

dal_table.TIER_ID=values("ID")

dal_table.Date_Modified=now()

dal_table.StudentID=values("StudentID")

dal_table.Modified_By=session("UserID")

dal_table.Modified_Table="MN_Action"

dal_table.Add()
H
hsan author 9/7/2012

Thanks Greg Mac for this input, but I am looking for something a little different. I need to automatically insert multiple records in a child table based on numeric value of a master table field "Qty". If master table field "Qty" is, let say, "3", a total of 3 new records should be automatically created in the child table. Furthermore, the newly created records should update "LineItem" field to "1 of 3", "2 of 3" and "3 of 3" respectively.
Thanks,

Nash