Linked table - with VBA?

MrNooby

Registered User.
Local time
Today, 04:55
Joined
Feb 21, 2010
Messages
58
If I use External data > Access and then "Link to data source by creating a linked table" I have to write strict full path where database is and this very limits my users from using application - they have to place it in the correct folder.

Is there any way that this wouldn't be strict, but using simple Application.CurrentProject.Path? Maybe in VBA on form load? I am searching for any code which would import database with password but can't find anything useful.
 
It is possible to link to an external mdb that is password protected. Placing the back end in the current project path is ok for single user systems but would not be suitable for a multi user arrangement.
 
Each user has his own database on his drive, when I'll make network database, then it will be OK to use without VBA code, but for now it's better to use VBA link to the same folder as project file is in as that I force user to place it in the folder which I want.
 
I tried that but even attached file FR Leads.zip doesn't work like it should. I tried the code anyway on my application but I get this "error":

Code:
The record source "Contacts" specified ion this form or report does not exist.


Even though path is OK...

I thought that there's any easier way with a few lines to simply load/link the DB.
 
I just noticed that even if I have linked to specific locations and if that file doesn't exist I get "Can not find file ..." and access stays opened and anyone can mess around in forms. Is there any way to create in code to check on start if file exists if not applications closes?
 

Users who are viewing this thread

Back
Top Bottom