Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to make a copy of a record using vba code at the click of a button

Status
Not open for further replies.

sundarun

MIS
Dec 12, 2003
2
AU
Hi Forumds,

I have a table of about 150 fields, some are images!. It's a machine setup instructions table.
The primary keys would be Instruction No, Issue No.

If I am to make a changes to few fields (even one field) I need to have record copied and increment the issue number. This is a requirement.

I have a combobox for part number which afterupdate lists the latest instruction in a listbox.

I need to update the instructions for this instruction number.

At the click of a button (say cmdUpdate), I need the desired record copied as new, without exiting the record (to avoid duplicate record problem), need to only increment the issue number, and open the data entry interface (the form with the new copied, incremented record) with the new record.

I believe that looping through fieldcollection would provide a solution.
But how do I implement this. I am just a novice programmer, fairly comfortable with form and report event properties, but not recordset manipulation. Can anyone help me please?
Just in case.. my email: sundarun7@yahoo.com
Thanks in advance.
sundarun
 
I'm a liyttle hazy on exactly what your after but you could try making a second ADODB recordset and use the .clone method of the original ADODB recordset. e.g.

Set rs2 = rs1.clone


Then you could manipulate rs2 as you see fit.

Mark

The key to immortality is to make a big impression in this life!!
 
Hi Mark,

Is it that simple? Would cloning do what I want?
This would be first attempt to any recordset manipulation.
Since the number of fields is so much, I was stuck, else I'd have individually assigned values of ech field to a temp container.

Let me try this..

Thanks Mark
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top