Reference Problems

gselliott

Registered User.
Local time
Today, 21:28
Joined
May 17, 2002
Messages
106
I am experiencing a few problems with References when I create a database running Access 2000 on a Win 2000 PC. The database will work fine on my PC but when it is run on another PC via Citrix using Access Runtime the Database will throw up runtime errors.

When this happens I have to logon to another PC and remove all of the references then add them again before the database will run properly. I have tried re-installing office but this hasn't fixed the problem.

Any ideas??
 
References

I have experienced similar problems when an Access 2000 user opens a 97 database. My cure is to include vb code to confirm the correct references exist on opening, and to run that code in the autoexec macro.

Public Function SetRef(strFileName As String, libPath As String) As Boolean
On Error GoTo Err_Ref
Dim Ref As reference, i As Integer
SetRef = False
For i = 1 To References.Count

If References(i).Name = strFileName Then ' if correct Ref
If CStr(References(i).FullPath) = libPath Then ' if Correct path
GoTo LeaveTrue
Else
Set Ref = References(strFileName)
References.Remove Ref
Set Ref = References.AddFromFile(libPath) ' add the correct Ref
GoTo LeaveTrue
End If
End If
Next i

IfNotFound:
Set Ref = References.AddFromFile(libPath)

LeaveTrue:
SetRef = True

Exit_Ref:
Exit Function

Err_Ref:
MsgBox Err.Description
Resume Exit_Ref

End Function

This function will remove an incorrect Reference and add the correct one, as long as you set the correct parameters, viz [in the autoexec]

RunCode
SetRef("Outlook","c:\program files\microsoft office\office\msoutl85.olb")

Natch, you'll have to find the correct Ref names, library file names and locations

Hope this helps
 

Users who are viewing this thread

Back
Top Bottom