Fe -> Be

KenHigg

Registered User
Local time
Today, 16:08
Joined
Jun 9, 2004
Messages
13,327
So I have done a db with a FE and a BE. And the user has the BE on the server and has the FE on the local machine. What is the best way to have the end user link the FE back to the BE? Have a form popup where the user enters the path and then run some code? Maybe some other way? Every db I've done in the past I have always been on site and have linked back manually myself but I need a simple way for the end user to link the tables...

A pseudo set of instructions would be:
1. Put this file on the server
2. Put this file on the local machine
3. Link the two by, etc, etc...

???
ken

EDIT:

I found this:

Link

Is this the best/easiest/most reliable way?

:)
ken
 
Last edited:
Do a search for "fRefreshLinks" - credit to Dev Ashish

This will do what you are looking for.
If you have any problems I have an example I can post up later.

Garry
 
Thanks! I'll give it a look - I can't seem to get the other code to work...

:)
ken
 
I'll be darn, exactly what I was trying to create -

I don't know how to thank you.

:)
ken
 
Follow up -

I think I'll just store a UNC to the table and have the table links refreshed every time the user opens the db instead of having to do a bunch of checking to see if this table is still linked and is that table relinked, etc...

If it errors on 3012 I simple skip the relink.

What do you think?

(I was having a hard time following the Getz routines and I don't like to put code out there I don't understand in case it zonks - :))

:)
ken
 
OK Ken, I understand where you are coming form,

But the easy way is to use the code with a few modifications,
With your first form to open, put code into the ON ERROR Event.
If the tables are linked ok then it will not trigger the Error Event.

If the table are not linked, then error event.

'first form to open Error Event
DoCmd.SetWarnings False
Select Case DataErr
Case 3024 ' cant find the BE
DoCmd.OpenForm "RelinkForm", acNormal, "", "", , acNormal
Response = acDataErrContinue
Exit Sub
Case 3044 ' cant find the BE
DoCmd.OpenForm "Relink", acNormal, "", "", , acNormal
Response = acDataErrContinue
Exit Sub
' End Code

Use this code to open up the relink form. Use the Relink for to call the refresh link table module.
This way it does not have to check the links each time the DB is opened.

Garry
 
Ken,

Forgot to mention, the first form must be bound for this to work.

Garry
 

Users who are viewing this thread

Back
Top Bottom