Hi Nigel,
I'm not sure what you mean by "That works in one instance". That code
actually does loop through a subset of the tables collection (the function
fGetLinkedTables() weeds out the ODBC connection tables). Regardless, here
is the basic code that demonstrates how you would loop through a recordset:
You can still use the code from fRefreshLinks as a guide for what you need
to do inside the loop. Basically you need the tablename and the path to the
linked database.
Open the recordset (once)
Test for records (EOF and BOF are both true when empty),
Loop through stopping when the EOF condition is reached.
Inside the loop we do something with each record,
Move to the next record
Close the recordset
Destroy the object variables.
Public Sub WalkRecordset()
Dim rst As DAO.Recordset
Dim db As DAO.Database
Set db = CurrentDb()
'tblMyTables is the name of your table
Set rst = db.OpenRecordset("Select * from tblMyTables")
With rst
If Not (.EOF And .BOF) Then
Do Until .EOF
' Here is the place to put the action you want to take on
' each record - use the code in fRefreshLinks as a guide
Debug.Print "TableName:" & .Fields("TableName")
.MoveNext
Loop
End If
.Close
End With
Set rst = Nothing
Set db = Nothing
End Sub

Signature
Sandra Daigle [Microsoft Access MVP]
Please post all replies to the newsgroup.
> That works in one instance but what I am looking for is
> code that looks at each record in the table and then adds
[quoted text clipped - 31 lines]
>>
>> .
Nigel Bennett - 09 Mar 2005 21:05 GMT
THe problem I have is that i have a table called address
and then another table called address1, they come from 2
different sources, so I need to make the code look in a
particular mdb for address and another mdb for the other
address table
>-----Original Message-----
>Hi Nigel,
[quoted text clipped - 74 lines]
>
>.
Sandra Daigle - 10 Mar 2005 13:37 GMT
The code will still work - just modify it to get the tablename and the path
to the backend database from your table.

Signature
Sandra Daigle [Microsoft Access MVP]
Please post all replies to the newsgroup.
> THe problem I have is that i have a table called address
> and then another table called address1, they come from 2
[quoted text clipped - 85 lines]
>>
>> .