I am trying to make a deployment package. Of course I have a split database and I want to have my tables automatically linked when it gets to the customers computer and is installed.
I have tried copying and pasting the code from here:
http://blogs.office.com/b/microsoft-...s-tables-.aspx
But it tells me that it doesn't work. And it doesn't!! When I test it on a computer without Access I get two messages: This file is a read only file, save this database to make design changes; and when I try to edit data: The file path: C:\%username&\Programs(x86)\recordkeeping_be.accdb is invalid. Make sure linked tables are on the same computer in the right folder.
This is the start of it:
Option Compare Database
Private Sub Form_Open(Cancel As Integer)
'----------------------------------------------------------------------------
' Procedure: RefreshTableLinks
' Purpose: Refresh table links to back-ends in the same folder as front end.
' Note: Linked Tables can be in more than one back-end.
' Return: Returns a zero-length string if all tables are relinked.
' Return: Or returns a string listing tables not relinked and errors.
'----------------------------------------------------------------------------
(MY WORDS HERE: a cursor comes here and a message box pops up that says Compile Error: Expected End Sub?????????????)
Public Function RefreshTableLinks() As String
On Error GoTo ErrHandle
Dim db As DAO.Database
Dim tdf As DAO.TableDef
Dim strCon As String
Dim strBackEnd As String
Dim strMsg As String
Dim intErrorCount As Integer
Set db = CurrentDb
'Loop through the TableDefs Collection.
For Each tdf In db.TableDefs
'Verify the table is a linked table.
If Left$(tdf.Connect, 10) = ";DATABASE=" Then
'Get the existing Connection String.
strCon = Nz(tdf.Connect, "")
I never have understood coding. My skull is too thick. Can you clearly explain what I need to do?