How to duplicate a record on a form with subform

D

dan

I have a main form that's source is a querry joining two
tables. A subform is joined with child parent child fields
so that a new record can be created in the sumform
automatically linking with the mainform. I want to
duplicate a record of the main form and the subform. What
is the best way to accomplish this. I tried using a querry
to find the current record on the Main form and created
three append querries to past the duplicated record into
the three associated tables. The problem is that this
works intermitently. The main form duplicates but the sub
form duplicated on a different record. They must be a
better way to do this with VBA

Any help would be appreciated
 
K

Kevin

Dan,

I do soomething like this, but I first put the data into a
temp table that is local to my Front-End application. Some
data is not copied (most notably the primary key). When I
do this, I copy the data to the temp table, then modify
the primary key value to something like "tempdata" (my
primary key is a text field assigned by the user). I then
copy this data to the normal table and display the record
in the form by applying a filter using that tempdata
value. When I display the record in the form, I display
the record, then remove the value in the primary key
field. The user is then required to assign a new value.
This works well.

Hope this helps!

Kevin
 

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