Please note the following code: For some reason it doesn't add the table LINKED_TABLE but it does not give any error. I just look in the navigation pane area and it doesn't appear - even after closing out and re-opening. No where the code dies but it just refuses to work. I know I'm close but still far - please help anyway you can!
I know some would rather give me some clues or links to more reading - which I have already done thus far. Right now, I'm just looking for the direct answer to solve this ASAP.
Private Sub Ensure_Table_Exists()
Dim sSQL As String
Dim dbs As DAO.Database
Set dbs = CurrentDb
If TableExists("LINKED_TABLE") = False Then
Dim tbl As TableDef, fld As Field, fld2 As Field
Set tbl = dbs.CreateTableDef("LINKED_TABLE")
' Creating the fields
Set fld = tbl.CreateField("Table_Name", dbText, 255)
Set fld2 = tbl.CreateField("Linked_FileName", dbText, 255)
Set fld2 = Nothing
Set fld = Nothing
Set tbl = Nothing
Set dbs = Nothing