Adding Multiple Records Via A Form

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sgtsaltandpepper
    New Member
    • Feb 2007
    • 2

    #1

    Adding Multiple Records Via A Form

    Hi, i am making a database to track the training courses that employees have to attend for my brothers company.

    There is one main table involved in what i am trying to do it is called trainingAttende nceT and has two fields sessionID and staffID. I want to be able to select the training session i want the employees to attend once, and then simply assign the employees to this via a form.

    At the moment i have a form which contains a sub form. The main form contains a combo box listing all the available sessions, the sub form contains a combo box listing all employees. This form is set to continuous forms view so that when a value is selected a new combo box appears allowing me to select another employee to attend the training session selected in the main form. When i then add the data to the table, it adds all the employees but does not assign them a session, it gives it the value 0 for all employees except one of them.

    Hopefully I made sense, and i hope that what i want to do is possible

    Many thanks in advance!
  • MSeda
    Recognized Expert New Member
    • Sep 2006
    • 159

    #2
    The value selected on the parent form won't automatically enter to new records created on a subform, you'll have to use some code somewhere to enter it.

    either in the subform's after insert event or on the employee combobox's on dirty event try
    Me.SessionID = Me.Parent.Form! SessionID
    of course change the names to match your controls

    hope this helps,
    Megan

    Comment

    • sgtsaltandpepper
      New Member
      • Feb 2007
      • 2

      #3
      Thanks for the reply megan, ill give that a try when i get home, its very frustrating as i have almost go it working, hopefully your suggestion works.

      Comment

      • NeoPa
        Recognized Expert Moderator MVP
        • Oct 2006
        • 32669

        #4
        Hopefully, but if not just come back and we'll have another look for you.
        Let us know how you get on :)

        Comment

        Working...