Creating a Duplicate Record from previously entered info. on a for

  • 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.
 
Sondra said:
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

Hi Sondra,

I'm assuming that the default values for DocVer, Binder1, Binder2, Binder3
and Binder 4 are always the same for DocumentID = 10.0.4.

In the "AfterUpdate" event of the control for DocumentID, place this code:
If (Me.DocID = "10.0.4") Then
Me.DocVer.Value = 1
Me.Binder1.Value = "yes"
Me.Binder2.Value = "no"
(and so on)
End if

Replace DocID, DocVer, Binder1, Binder2 etc. with the corresponding control
names on your form.

Hope this helps.

-Amit
 
Sondra said:
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



You can create a new record in the form's record set using
code like:

With Me.RecordsetClone
.AddNew
!DocumentID = Me!DocumentID
!DocVer = "1.1"
!Binder1 = Me!Binder1
!Binder2 = "yes"
!Binder3 = "no"
!Binder4 = Me!Binder4
.Update
Me.Bookmark = .LastModified 'go to new record
End With
 
Back
Top