I don't mind posting it here since it's code that I found and modified. I can't write code but I can sure 'borrow' and modify.
I found and tried to use this exactly as found, I thought that if I made a button that the users had to push it would force the refs;
Function FixUpRefs()
Dim loRef As Access.Reference
Dim intCount As Integer
Dim intX As Integer
Dim blnBroke As Boolean
Dim strPath As String
On Error Resume Next
'Count the number of references in the database
intCount = Access.References.Count
'Loop through each reference in the database
'and determine if the reference is broken.
'If it is broken, remove the Reference and add it back.
Debug.Print "----------------- References found -----------------------"
Debug.Print " reference count = "; intCount
For intX = intCount To 1 Step -1
Set loRef = Access.References(intX)
With loRef
Debug.Print " reference = "; .FullPath
blnBroke = .IsBroken
If blnBroke = True Or Err <> 0 Then
strPath = .FullPath
Debug.Print " ***** Err = "; Err; " and Broke = "; blnBroke
With Access.References
.Remove loRef
Debug.Print "path name = "; strPath
.AddFromFile strPath
End With
End If
End With
Next
'''Access.References.AddFromFile "C:\Program Files\Common Files\Microsoft Shared\DAO\dao360.dll"
Set loRef = Nothing
' Call a hidden SysCmd to automatically compile/save all modules.
Call SysCmd(504, 16483)
End Function
Function AddRefs()
Dim loRef As Access.Reference
Dim intCount As Integer
Dim intX As Integer
Dim blnBroke As Boolean
Dim strPath As String
On Error Resume Next
'Loop through each reference in the database
'Add all references
Debug.Print "----------------- Add References -----------------------"
With Access.References
.AddFromFile "C:\Program Files\Common Files\Microsoft Shared\DAO\dao360.dll"
.AddFromFile "C:\Program Files\Common Files\Microsoft Shared\VBA\VBA6\vbe6.dll"
.AddFromFile "C:\Program Files\Microsoft Office\Office\msacc9.olb"
.AddFromFile "C:\Program Files\Common Files\System\ado\msado15.dll"
.AddFromFile "C:\Program Files\Common Files\System\ado\msado25.tlb"
.AddFromFile "C:\Program Files\Common Files\System\ado\msadox.dll"
.AddFromFile "C:\WINNT\System32\stdole2.tlb"
.AddFromFile "C:\WINNT\System32\scrrun.dll"
End With
' Call a hidden SysCmd to automatically compile/save all modules.
Call SysCmd(504, 16483)
End Function
It didn't work but in the immediate window when I ran the code, this came up;
----------------- References found -----------------------
reference count = 8
reference = C:\Program Files\Common Files\System\ado\msador15.dll
reference = C:\Program Files\Common Files\System\ado\msado26.tlb
reference = C:\Program Files\Common Files\Microsoft Shared\OFFICE11\MSO.DLL
reference = C:\Program Files\Common Files\Microsoft Shared\VBA\VBA6\VBE6EXT.OLB
reference = C:\WINNT\system32\stdole2.tlb
reference = C:\Program Files\Common Files\Microsoft Shared\DAO\DAO360.DLL
reference = C:\Program Files\Microsoft Office\Office\MSACC9.OLB
reference = C:\Program Files\Common Files\Microsoft Shared\VBA\VBA6\VBE6.DLL
The problem is I don't know what to do with this information.
I guess I do not understand where the references need to be. When I create a DB, are the references stored on my PC or with the DB? I am assuming that they get stored on my PC since in my situation above, I can't get full functionallity of the DB from the server on others PCs.
I'm not really good at this yet, I can't write code but if I find some that might work, I can usually use that and modify it to work.
Thanks in advance for any help that you can give me.