Hoe do I - Link to tables using code

  • Thread starter Thread starter David Peterson
  • Start date Start date
D

David Peterson

My database has one linked table.
How can I offer users the ability to change the link?

What I want is a button for each connection offered, like
button one - links to ;DATABASE=C:\My Documents\Address.mdb
button two - links to ;DATABASE=O:\Office Documents\Address.mdb
button three - links to ;DATABASE=N:\Private Documents\Address.mdb

pressing the button would let them choose the table link.
 
I believe the code you recommended will do what I want but I cannot get it
to run.
I copied the example codes to a module in my db.

Compiling gives me the error:
User-defined type not defined, for this line;
Function fIsRemoteTable(dbRemote As Database, strTbl As String) As Boolean

Any ideas??
 
There is some code from Ken Getz at http://mvps.org/access I believe it's
titled "Refresh Links". I've used it to attempt to reconnect to the back
end looking in the same path as the front end. In the event it can't find
the back end it puts up the APE call to the common dialog to find a file.
Of course, you could have a table or other mechanism to maintain
configuration variables that might hold the, user modifiable, default
values.

HTH
 
What version of Access are you using? If it's Access 2000 or higher, did you
remember to set a reference to DAO?
 
the DAO reference was the problem, thanks

Douglas J. Steele said:
What version of Access are you using? If it's Access 2000 or higher, did you
remember to set a reference to DAO?
 
Back
Top