Duplicate a Form's Entries

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Don't know if this is possible or not, but hope someone can help.

I use Access 2002.

My form contains the following fields:
DocumentID
DocumentVersion
Binder1
Binder2
Binder3
Binder4

What I need to know is there a way to have a new record created by
duplicating a previous records entry.

For Example:
Record #1
DocumentID = 10.0.4
DocVer = 1.0
Binder1 = yes
Binder2 = no
Binder3 = yes
Binder4 = yes

Create Record #8
enter DocumentID as 10.0.4

Form Pre-fills with the following information:
DocVer = 1.0
Binder1 = yes
Binder2 = no
Binder3 = yes
Binder4 = yes

Changes:
DocVer = 1.1
Binder2 = yes
Binder3 = no

EndResult =

Record #1
DocumentID = 10.0.4
DocVer = 1.0
Binder1 = yes
Binder2 = no
Binder3 = yes
Binder4 = yes

Record #8 is now
DocumentID = 10.0.4
DocVer = 1.1
Binder1 = yes
Binder2 = yes
Binder3 = no
Binder4 = yes

Any guidance would be FANTASTIC!!!

Thanks.
 
Hi, Sondra.

I take it that your primary key is either a combination of the first two
fields, or a single AutoNumber that you haven't shown here.

If there already exists more than one version for the document, which one
would you like to use as the template? This can be done with DLookup calls,
but in order to retrieve the information from the right record, I'll need to
know what DocumentVersion to look up. Always "1.0"? Or the first one? The
last one? One you specify?

Sprinks
 
Hi Sprinks:

I want the last record to appear. But a question for you. If I use the
DLookup that will only show the records correct?

I want to actually have the record written. So if there is already:

Document ABC version 1.0 and the form pulls all the fields up for that
record and I change the version to 2.0 that there will now be to records in
the table.

Thanks for you help.
 
Hi, Sondra.

Yes, I'd been thinking we'd know ahead of time which version to use as a
template, then use DLookup calls to assign the fields to variables, then
write them out to the current record. However, I don't know how to base the
data off of the last VersionNumber of the entered DocumentNumber.

I suspect the route will be to navigate through a recordset, finding the
last version of the current document, writing the fields to an array, and
writing them out to your record; but, unfortunately, I don't know how to do
this. I suggest you repost for the VIPs as many will only answer unanswered
questions.

Sorry I couldn't help.
Sprinks
 
Thanks for your help.



Sprinks said:
Hi, Sondra.

Yes, I'd been thinking we'd know ahead of time which version to use as a
template, then use DLookup calls to assign the fields to variables, then
write them out to the current record. However, I don't know how to base the
data off of the last VersionNumber of the entered DocumentNumber.

I suspect the route will be to navigate through a recordset, finding the
last version of the current document, writing the fields to an array, and
writing them out to your record; but, unfortunately, I don't know how to do
this. I suggest you repost for the VIPs as many will only answer unanswered
questions.

Sorry I couldn't help.
Sprinks
 
Back
Top