View Full Version : creating multiple records at once


IMBOYCE
01-07-2002, 11:20 AM
Hi everyone, Hope I explain myself correctly, but here goes. I have a form that a user enters a date and clicks ok. I then want to add 10 more records at once. The best way to explain this is using a soccer team scenario. If, everyday, I want to assess a players progress I have 2 tables related. One main table has the date as key and the second table has the date and player name as concatenated key. Once I create the
date in the main table I want to automatically create the whole team for that date - somehow appending to the second table in one go?

Pat Hartman
01-07-2002, 04:57 PM
You need to do this with an append query.

I presume you have a Roster table or Player table that contains a row for each player containing the TeamId and PlayerId for each player on the team.

Create a query that selects all the players for a particular team (or all players if you want to do all teams at once) and appends the selected records to your evaluation table. Refer to the date field on the form to obtain the date field you need for each of the player records.

Insert Into tblEval (EvalDt, PlayerId, TeamId) Select Forms!YourFormName!YourControlName as EvalDt, PlayerId, TeamId
From Yourtable;