nickperez22
Technical User
I just created a new table in code, how do I link it in code to the front end. Table name "Titles
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Function ConnectToAccess(DatabasePath As String) As Integer
On Error GoTo connectToAccesserr
Dim tbl As TableDef
Dim stablename As String
For Each tbl In CurrentDb.TableDefs
If tbl.Connect <> "" Then ' Isn't a local table
stablename = tbl.Name
CurrentDb.TableDefs.Delete (stablename)
DoCmd.TransferDatabase acLink, "Microsoft Access", _
DatabasePath, acTable, stablename, stablename
End If
Next
CurrentDb.TableDefs.Refresh
DoCmd.OpenForm "switchboard"
ConnectToAccess = -1
connecttoaccesserrexit:
Err = 0
Exit Function
connectToAccesserr:
MsgBox Error$(Err)
ConnectToAccess = 0
GoTo connecttoaccesserrexit
End Function
Sub linkOneTable()
dim stablename as string
stablename = "Your Table name here"
CurrentDb.TableDefs.Delete (stablename)
DoCmd.TransferDatabase acLink, "Microsoft Access", DatabasePath, acTable, stablename, stablename
CurrentDb.TableDefs.Refresh
end sub