Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to Share Forms and VBA

Status
Not open for further replies.

f15x

Programmer
Jun 6, 2005
2
US
I am familiar with the common technique of splitting the Front-end (forms, reports, and VBA code) from the back-end data. I would like to take this concept a bit farther by having a common front-end, but allow that front-end to run against multiple back-end databases. The benefit of this would be that instead of maintaining 5 copies of the same front-end forms and code, it would be done only once. Does anyone have recommendations as to the best way this can be achieved?
 
Hi

I have done something similar to this before, technique I used was to have a form which allowed the user to select the backend to use, then to relink the tables accordingly. I also included the name and path of the currently linked database at the bottom of the switchboard from, so the user could see at a glance which db they were currently linked to.

Hope this helps

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
KenReay, thank you for the suggestion, but I don't want to fiddle with relinking tables because that would affect other user's who might be using the same (shared) front-end but against a different set of back-end tables.

Does Access have a friendly way of sharing forms and code effectively across databases?

The best/simpliest approach I have considered yet, is the following:
1) Front-end .mdb links the table to K:\backend_data.mdb

2) Application is started from 5-different dos-batch-files. First step of each batch-file is:
subst k: /d REM Delete K: drive-letter
subst k: c:\location_of_backend_database
Then, batch-file then starts the front-end database. The drive-letter mapping would effectively cause the back-end data to be pointing to the desired data.

Although I have tested this, and it works, it seems there is probably a better way of doing this. When I went looking, every approach I have found so far, is very messy. Any other ideas out there?

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top