By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
463,195 Members | 614 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 463,195 IT Pros & Developers. It's quick & easy.

Adding Multiple Records Via A Form

P: 2
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 trainingAttendenceT 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!
Feb 7 '07 #1
Share this Question
Share on Google+
3 Replies

Expert 100+
P: 159
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,
Feb 8 '07 #2

P: 2
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.
Feb 8 '07 #3

Expert Mod 15k+
P: 31,770
Hopefully, but if not just come back and we'll have another look for you.
Let us know how you get on :)
Feb 9 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.