Click to See Complete Forum and Search --> : ADO Data Bound Grid
JacquesC
Aug 23rd, 2000, 01:30 AM
I know I shouldn't duplicate the primary keys, but I still need to duplicate a record, then edit one or two fields (the record contains about 150 fields). Right now I'm using the .Addnew method, and then I have to give each field a value one by one ! This gets a bit tedious, there must be an easier way !
Bill Crawley
Aug 23rd, 2000, 10:38 AM
Hi,
You could try using the clone method this will copy the original data, then change the individual field elements before saving. The other method that you may also find useful is the BatchUpdate method if you want to post records back after making changes to more than one record.
JacquesC
Aug 25th, 2000, 05:07 AM
Hey Bill, thanx for the response. I'm using the .Clone method at the moment to duplicate the records, the best I can do looks something like this :
With AdoDataBurr.Recordset
Set AdoTemp.Recordset = .Clone
AdoTemp.Recordset.AbsolutePosition = .AbsolutePosition
.AddNew
!Sched = AdoTemp.Recordset!Sched
!InCID AdoTemp.Recordset!InCID
etc,
etc,
etc
.Update
End With
Is there a better way?
The other problem is how to insert a record into another table. The older drivers you could say something like:
DiskDB.Execute ("Insert into Table1 Select * from Table2")
How to I do this with ADO controls?
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.