huh? This code is missing a serious chunk! Okay, assuming that the
code is copying field by field into the new table, you need to do
something like
'--add a new blank record to the destination table
rsDest.AddNew
'---populate all the fields in the new record from values from the
current record in the source table
for intCounter = 0 to rsSrc.Fields.Count-1
rsDest.Fields(intCounter) = rsSrc.Fields(intCounter)
next intCounter
'---save the values in the new record
rsDest.Update
Okay, so then you have to call that for each record in the source
table, so you wrap it in a Do Until rsSrc.EOF thing and away you go.
dixie - 12 Feb 2005 07:49 GMT
The code is supposed to be complete and is at
http://www.mvps.org/access/tables/tbl0018.htm - I just altered the names of
the tables involved and then the line:
NewRes![ResID] = OldRes![ResID] which I took to be the uniqe ID number for
> huh? This code is missing a serious chunk! Okay, assuming that the
> code is copying field by field into the new table, you need to do
[quoted text clipped - 13 lines]
> Okay, so then you have to call that for each record in the source
> table, so you wrap it in a Do Until rsSrc.EOF thing and away you go.
dixie - 12 Feb 2005 07:59 GMT
Sorry about the formatting of that last message. It just occurred to me
Pieter after I reread your message that the single line:
NewRes![ResID]=OldRes![ResID] is just an example of doing one of the fields
of the table. So, I do have to include all the fields as lines at that
stage of the code. There are a lot of fields in this table. I like your
code that seems just to automatically add each field. I presume I need to
dim intcounter as something before I can use that code - dim intCounter as
integer?
I'll have a play with it with a smaller table.
Thanks
dixie
> huh? This code is missing a serious chunk! Okay, assuming that the
> code is copying field by field into the new table, you need to do
[quoted text clipped - 13 lines]
> Okay, so then you have to call that for each record in the source
> table, so you wrap it in a Do Until rsSrc.EOF thing and away you go.
dixie - 15 Feb 2005 03:27 GMT
Well, I must admit I've given up on making this work easily. I had a
corrupted table last week with over 15,000 records which I had to search
through for 2 corrupted records, then copy block by block the good messages
as I couldn't delete the corrupted ones. This is just so slow. If I could
have had this working, I am sure I could have pressed a button and made a
nice cup of tea.
dixie
> huh? This code is missing a serious chunk! Okay, assuming that the
> code is copying field by field into the new table, you need to do
[quoted text clipped - 13 lines]
> Okay, so then you have to call that for each record in the source
> table, so you wrap it in a Do Until rsSrc.EOF thing and away you go.