Code, Doubles size of Database

  • Thread starter Thread starter John
  • Start date Start date
J

John

Hello all,

I am wondering if any of you can help out with a very
perplexing issue that I am coming up with. I run the
following code to append records to a table, using another
table as a recordsource.

rDestin.MoveFirst
Do Until rDestin.EOF
If rDestin!L35_Fnd = True Then
Else
rSource.Seek "=", rDestin!CC_Num
If rSource.NoMatch Then
Else
rDestin.Edit
If rSource!parent_node_level = 35
rDestin!L35 = rSource!parent_node
rDestin!L35_Fnd = True
Else
rDestin!calc = rSource!parent_node
rDestin!L35_Fnd = False
End If
rDestin.Update
End If
End If
rDestin.MoveNext
Loop

Is there any other code that would not double the size of
the code? Any help would be greatly Appreciated.

Thanks
 
I don't see any AddNew, so I don't understand how you can be appending
records to a table. You seem only to be updating existing records.

What, in words, is it you're trying to do? It strikes me that you should be
able to use SQL to do it, rather than having to loop through a recordset
like that.
 
Hi Thanks for the response. You are correct I am just
trying to update my original, Destination table to include
a field in the Source table.

So essentially this is what I am trying to do...
Run through all the records in Table1(Destin), take a
field from this table and search Table2(Source) for that
record, once found, I want to update Table1 with a value
found in Table2, not the same value but one found on the
same line.

ex. Table1 has the following fields ID, Name, ConsID,
Calc, L35_found.
Table2 has the following Fields ID,Name, ParentID,
Parent_level.

So I want to do a search that finds Parentid with a
Parent_Level of 35, sometimes this requires mutliple steps
as there are levels in between, therefore I have to put
the identifier in a filed called Calc, and keep L35_Found
unchecked. Next time through the table I will use the cal
field as the index on Table2.

Hopefully this all makes sense. Any help would be greatly
appreciated.

Thanks
 
Back
Top