How do you create Multiple Records using One Input Form?

  • Thread starter Thread starter Harry J.
  • Start date Start date
H

Harry J.

We have a situation where we have been tasked to input training
informaiton about indivdual groups of employees.

(Maybe this should be posted to a different group - if so, let me
know)

Currently that means opening 40 plus records for each class taken and
entering the same information over and over, etc., etc.

What we would like to do is use a single form where the user.
(1) selects the group (Dropdown menu)
(2) inputs the training date (Sometimes the info is days old)
(3) selects the class attended (Dropdown menu)
(4) clicks a button to create a training record for everyone in that
group.

How can this be done using VBA coding on a form?

I can get it to work for one record, but can't seem to get the coding
for a loop to work right. (i.e. do while the group is xyz, or do
while not EOF(1))
Can someone help me out here?


Thanks.
 
Harry said:
We have a situation where we have been tasked to input training
informaiton about indivdual groups of employees.

(Maybe this should be posted to a different group - if so, let me
know)

Currently that means opening 40 plus records for each class taken and
entering the same information over and over, etc., etc.

What we would like to do is use a single form where the user.
(1) selects the group (Dropdown menu)
(2) inputs the training date (Sometimes the info is days old)
(3) selects the class attended (Dropdown menu)
(4) clicks a button to create a training record for everyone in that
group.

How can this be done using VBA coding on a form?

I can get it to work for one record, but can't seem to get the coding
for a loop to work right. (i.e. do while the group is xyz, or do
while not EOF(1))

In general you'll probably open a recordset on the table
with the group/emplyee information (with a Where clause to
get just the one group) and loop through the records in the
recordset:

Set rs = db.OpenRecordset( ? ? ?
Do Until rs.Eof
'whatever you need to add records
'either AddNew to another(?) recordset
'or executing an append query
rs.MoveNext
Loop

You'll have to post the table structure (tables, their
relevant fields, primary key and foreign keys) if you need
more specific help.
 
Back
Top