keschuster
asked on
MS Access VBA - returning a collection
I dug up a bit of code to handle relinking tables in MS Access. Are part of it uses this function below to grab all of the linked table names.
when I run it I get an error I can't figure out.
Run-time error '450'
Wrong Number of Arguments or invalid property assignment.
Can anyone tell me why?
when I run it I get an error I can't figure out.
Run-time error '450'
Wrong Number of Arguments or invalid property assignment.
Can anyone tell me why?
Function fGetLinkedTables() As Collection
'Returns all linked tables
Dim collTables As New Collection
Dim tdf As TableDef, db As Database
Set db = CurrentDb
db.TableDefs.Refresh
For Each tdf In db.TableDefs
With tdf
If Len(.Connect) > 0 Then
If Left$(.Connect, 4) = "ODBC" Then
collTables.Add Item:=.Name & ";" & .Connect, Key:=.Name
'ODBC Reconnect handled separately
Else
collTables.Add Item:=.Name & .Connect, Key:=.Name
'Debug.Print tdf.Name
End If
End If
End With
Next
Set fGetLinkedTables = collTables
Set collTables = Nothing
Set tdf = Nothing
Set db = Nothing
End Function
ASKER
I've requested that this question be deleted for the following reason:
seems to have resolved itself
seems to have resolved itself
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
keschuster
What fixed the problem ?
It worked as is for me.
What fixed the problem ?
It worked as is for me.
mx