Jump to content
  • 0

Trigger to Create Multiple New Entries on a Different Table


matrix1108

Question

Hi everyone! I'm looking for help with the following:

For my project, an "Enrollment"  will consist multiple "Lessons". The number of lessons each enrollment has could vary. It could have 6 lessons, 12 lessons, 18 lessons, etc. (also known as lesson_total)

To give you an idea, here's how they are related.

image.png.c3a6a2a79cfd1cd9b0470d699530634c.png

I created a DataPage so that the user can add entries in tbl_enrollment.

I want to set up a trigger so that if an entry in tbl_enrollment is created, multiple entries under tbl_lesson will be created, with the same enrollment_ID's. The number of entries created will depend on lesson_total in tbl_enrollment.

For example, if user inputted "12" in lesson_total (in tbl_enrollment), there would be 12 new lesson_ID's with the same enrollment_ID in tbl_lesson.

 

I hope someone could help me! Thanks!! 

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...