For Each vCounty In lstWeather.ItemsSelected
CID = Me.lstWeather.Column(7, vCounty)
Path = DLookup("LocalPath", "CountyCode", "CountyCode = " & CID)
FileName = Path & "EngineRoom\CODispatch_be.accdb"
Set rdb = OpenDatabase(FileName)
Set dbsTemp = CurrentDb
' Call the ConnectOutput procedure. The third argument
' will be used as the Connect string, and the fourth
' argument will be used as the SourceTableName.
ConnectOutput dbsTemp, _
";DATABASE= " & FileName, _
Sub ConnectOutput(dbsTemp As Database, _
strTable As String, strConnect As String, _
strSourceTable As String)
Dim tdfLinked As TableDef
Dim rstLinked As Recordset
Dim intTemp As Integer
' Create a new TableDef, set its Connect and
' SourceTableName properties based on the passed
' arguments, and append it to the TableDefs collection.
Set tdfLinked = dbsTemp.CreateTableDef(strTable)
tdfLinked.Connect = strConnect
tdfLinked.SourceTableName = strSourceTable
I googled into this post and thought all my problems were solved. However, I appear to have stumbled into an suffix issue with TableDefs.Append and accdb. Whenever I run the code, I get an error 3055. The onboard help indicates this is a problem with the naming convention in the operating system. All of the code in the examples/Microsoft use the mdb (pre 2007) extension. Anbody have a work-around for this?