Copying Records

C

Chaplain Doug

I need to set up a form that will display all of the
people in a class (No problem here). I want to be able to
mark some of the students to be rolled over into the next
class (since they did not finish) and create a class
record for them for the new class. I need to retain the
old class record and basically duplicate the old record
into a new record for the new class with a few field
changes (like changing the class cycle number to the new
number). Can anyone suggest an easy way to do this.

It would be nice if I could just mark or check the ones I
want to duplicate and then press a button to perform the
copy (with code behind the button that copies and updates
the fields I want to update in the new records). Thanks
for any help.

P.S. If my fuzzy description dissuades anyone from trying
to answer, I would be happy to clarify. God bless.
 
P

PC Datasheet

You need a Yes/No field in your Students table named Selected. Then build a
continuous form that includes the Selected field and Student name. You can use
this form to select the student records you want to copy.

Next build an append query based on the Student table and include the Selected
field and all other fields. Set the criteria of the Selected field to True so
that you copy over only the students you select. After selecting the students on
your continuous form, run the append query.

The selected students will still be marked as selected in the Student table so
you need to clear the selected field. Create an Update query based on the
Student table and only include the Selected field. Mark this field to update to
False. Run the query and the Selected field for all the records will be cleared.
 
J

John Vinson

I need to set up a form that will display all of the
people in a class (No problem here). I want to be able to
mark some of the students to be rolled over into the next
class (since they did not finish) and create a class
record for them for the new class. I need to retain the
old class record and basically duplicate the old record
into a new record for the new class with a few field
changes (like changing the class cycle number to the new
number). Can anyone suggest an easy way to do this.

Run an Append query, appending the selected records to the same table.

Ordinarily you would not want to duplicate very many fields - in
particular, if you're duplicating the student's bio information your
tables may not be structured correctly! For a class enrollment
database you would typically have a table of students, a table of
classes, and an Enrollment table with very few fields (StudentID,
ClassID, DateEnrolled, maybe a couple more at the most). Is this your
structure?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top