Macro to relink db to be file?

G

Grace

Hello, can I use a Macro to perform a database "relink"?
I would like to have a button that runs a macro that will
relink all the tables to a back end file set in a folder
on local server. Can a macro handle this or do I need VB?

Thank you,
Grace
 
G

Grace

I added this code to a button. I am getting a runtime
error when it prompts to specify a different path for the
Access Tables. The compile error says that the sub or
function is not defined and brings me to this line:

Function fGetMDBName(strIn As String) As StringFunction
fGetMDBName(strIn As String) As String

Is this supposed to bring up a dialog box to locate the be
file?

Thanks again,
Grace
 
B

Bruce M. Thompson

I added this code to a button. I am getting a runtime
error when it prompts to specify a different path for the
Access Tables. The compile error says that the sub or
function is not defined and brings me to this line:

Function fGetMDBName(strIn As String) As StringFunction
fGetMDBName(strIn As String) As String

Is this supposed to bring up a dialog box to locate the be
file?

You need to include the "GetOpenFileName" code (this is stated on the page from
which you retrieved your other code). It is available at:

http://www.mvps.org/access/api/api0001.htm
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top