sql - Insert X rows into child table based on parent field -
trying insert set number of rows child table based on number entered parent table
parent (licenseid, poolsize) child (nodeid, licenseid)
i looking using after insert trigger on parent table not figure out how loop create record command.
is possible macros or should looking @ vba code? (ms access 2010)
first of all, never enter directly table. giving users kind of ability going end in form of misery , regret.
i creat form take number, , use code behind "submit" button loop required number of times. (this code entirely untested):
dim db database dim rec recordset dim x double set db = currentdb set rec = db.openrecordset ("child") x = 1 me.txtnumberofentries rec.addnew rec("licenseid") = me.txtlicenseid rec.update next x 'always clear out variables set rec = nothing set db = nothing
Comments
Post a Comment