INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Broken References when switching back and forth in MS Access 07-16

Broken References when switching back and forth in MS Access 07-16

(OP)
Ok, I have a database at work on our server and only one person is on it at a time and only about 5 people use it total and the odds of two people on it at the same time are slim to none and everyone here has 2007 MS access. Now one of the employees got a new PC with a upgraded version of Access 2016 and when they open the database it changes the references to 16.0 Object Library from 12.0 and it works on that machine then when the users on the machines with the 2007 access open the DB none of the querys work ect because of the broken reference to Object Library 12.0 and Irun a debug and im missing for some reason Microsoft Outlook 12.0 Object Library. Once I uncheck the broken 16.0 broken reference and get the Microsoft Outlook 12.0 Object Library everything works in 2007 again until the user in access 2016 opens it again.

Here is my question, can I clear broken references and install Microsoft Outlook 12.0 Object Library using VBA On Load of the DB? eventually we all will have the 2016 but that wont be for another year or so...

Thanks,

Thanks,
SoggyCashew.....

RE: Broken References when switching back and forth in MS Access 07-16

Isn't your application split into front-end and back-end files with everyone getting their own copy of the front-end?

You can typically use "late binding" to avoid this type of issue.

Duane
Minnesota
Hook'D on Access
MS Access MVP 2001-2016

RE: Broken References when switching back and forth in MS Access 07-16

(OP)
Duane it wasnt split and i tried to split it and had a user with a copy of 2016 on thier PC open it and it worked then I went on my PC which has 2007 and it had the broken reference 16.0. This was checked on the be

Thanks,
SoggyCashew.....

RE: Broken References when switching back and forth in MS Access 07-16

As mentioned, late binding should work, but you really should run all shared DBs as split for performance reasons, compatibility, and to avoid corruption. It is very easy to corrupt a DB in this manner even if it is unlikely that 2 or more people are in at the same time.

RE: Broken References when switching back and forth in MS Access 07-16

(OP)
Ok the split and putting the FE on the PC got rid of the reference issue now I have a different issue. My database uses images from a folder that was always with the database and now that the FE is on the desktops and the BE is separate I don't get images using the function below...

CODE --> VBA

Public Function GetCurrentPath() As String

         'Gets path of current DB
           GetCurrentPath = Application.CurrentProject.Path '& "\"
           
End Function 

Thanks,
SoggyCashew.....

RE: Broken References when switching back and forth in MS Access 07-16

The path is data and should be stored in a table.

Duane
Minnesota
Hook'D on Access
MS Access MVP 2001-2016

RE: Broken References when switching back and forth in MS Access 07-16

If the files are always stored in the same folder as the backend tables then you can do it as follows

CODE -->

Public Function GetBackendPath(LinkedTableName As String) As String
     Dim connection As String
     Dim DB_PathAndFile As String
     connection = CurrentDb.TableDefs(LinkedTableName).Connect
     DB_PathAndFile = Mid(connection, 11)
     GetBackendPath = Left(DB_PathAndFile, InStrRev(DB_PathAndFile, "\"))
End Function 

Pass in the name of one of the linked tables to the function.

RE: Broken References when switching back and forth in MS Access 07-16

(OP)
Thank you!

Thanks,
SoggyCashew.....

RE: Broken References when switching back and forth in MS Access 07-16

BTW you can make that function more generic. You first would check if it is a linked table or not
If Len(connection) > 0 Then it is linked
Then add an if then. If it is a linked table do what I showed, if not not use your original function for current path.

RE: Broken References when switching back and forth in MS Access 07-16

(OP)
Majp, I couldn't get your example to work for the images, the below worked... Whats the diference?

CODE --> VBA

Public Function GetCurrentPath() As String

'Gets path of current BE table txtVWI, Used  all images
'Put images in with BE file

    Dim strFullPath As String
    strFullPath = Mid(DBEngine.Workspaces(0).Databases(0).TableDefs("tblVWI").Connect, 11)
    GetCurrentPath = Left(strFullPath, InStrRev(strFullPath, "\"))
End Function 

Thanks,
SoggyCashew.....

RE: Broken References when switching back and forth in MS Access 07-16

I still wouldn't ever assume the path was going to be related to the location of some other file. Someone will come along and expect the image files to move to a totally different shared location. All you should have to do is change the value of one field in one table.

Duane
Minnesota
Hook'D on Access
MS Access MVP 2001-2016

RE: Broken References when switching back and forth in MS Access 07-16

(OP)
Do you guys have a easy to use auto updater for if I want to update the database? Right now I have the BE on server in a folder named VWI Backend and I have the FE in a folder named VWI FE and I have a master copy of the FE on my PC. Now lets say I want to update the BE and distribute how can I do this the easy way? Please explain I watched some videos and downloaded examples and im not getting it... I tried tonys auto updater and sent an email and it installs a shortcut of the FE on your desktop and im not sure if that was correct because from what I understand the FE is a copy of the DB not a shortcut..

Thanks,
SoggyCashew.....

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close