How can I duplicate a record

I

Iram

Hello.
I am using Access 2003.
I have a continuous form that pulls data from two tables that are linked by
a One to One relationship "tbl_Information" and "tbl_InformationContinued".
It's funny, its just how I got it!
In any case in this continuous form I want to put a checkbox next to each
record and a button at the top of the screen under Page Header to give me the
flexibility to select a particular record with the check box then click the
button at the top to duplicate it and requery the continuous form so that the
record and the duplicate are visible. Also after duplicating I need to clear
out certain fields.


How would I do this and what other information would you need to help me?


Thanks.
Iram/mcp
 
P

PieterLinden via AccessMonster.com

Iram said:
Hello.
I am using Access 2003.
I have a continuous form that pulls data from two tables that are linked by
a One to One relationship "tbl_Information" and "tbl_InformationContinued".
It's funny, its just how I got it!
In any case in this continuous form I want to put a checkbox next to each
record and a button at the top of the screen under Page Header to give me the
flexibility to select a particular record with the check box then click the
button at the top to duplicate it and requery the continuous form so that the
record and the duplicate are visible. Also after duplicating I need to clear
out certain fields.

How would I do this and what other information would you need to help me?

Thanks.
Iram/mcp

you could create a query based on the "tbl_InformationContinued" table that
selected all the records where the checkbox field was set to True and then
turn that into an append query. If you don't specify some values in the
insert statement, they will be set to Null.... Just don't include the
Autonumber field from the tbl_InformationContinued table. Sounds like a
weird design if you have "tbl_InformationContinued"... Is it really a one-to-
many relationship between tbl_Information and tbl_InformationContinued? Just
sounds weird.
 
M

Marshall Barton

Iram said:
I am using Access 2003.
I have a continuous form that pulls data from two tables that are linked by
a One to One relationship "tbl_Information" and "tbl_InformationContinued".
It's funny, its just how I got it!
In any case in this continuous form I want to put a checkbox next to each
record and a button at the top of the screen under Page Header to give me the
flexibility to select a particular record with the check box then click the
button at the top to duplicate it and requery the continuous form so that the
record and the duplicate are visible. Also after duplicating I need to clear
out certain fields.


If you only want to duplicate one record at a time, you do
not need a check box, just a command button to copy specific
fields in the current record. I have never had a problem
wuth users being confused by a single button in the form's
header or footer, but if you want to see the button on every
record, just put it in the detail section.

I suggest that the button's Click event procedure use
something like:

'save any changes to current record
If Me.Dirty Then Me.Dirty = False
'copy specific fields
With Me.RecordsetClone
.AddNew
!thisfield = Me.thisfield
!thatfield = Me.thatfield
. . .
.Update
'make copy the current record
Me.Bookmark = .LastModified
End With
 

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

Similar Threads


Top