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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access97 equivalent or work around for Access2000 AddFromFile 1

Status
Not open for further replies.

SBendBuckeye

Programmer
May 22, 2002
2,166
US
Just found out that a project which was supposed to be local stand alone is going to be rolled out via email. I have included some additional libraries in the project which will need to be loaded as references.

In Access2000, you can do Refences.AddFromFile to register them. How do I do that in Access97? I have never had to do anything in this area of Access before.

Thanks in advance for any help! Please remember to give helpful posts the stars they deserve! This makes the post more visible to others in need![thumbsup]
 
I'm a little confused here. The AddFromFile shows up in Access97 help but when I copy the code into a module, I get a compile error for that statement. Please remember to give helpful posts the stars they deserve! This makes the post more visible to others in need![thumbsup]
 
SBendBuckeye,

This works in Access 97 ...


' ***************************************
Private Sub SetRefs_Click()
Dim ref As Reference
Dim intRef As Integer
Dim ErrorMsg As String

On Error GoTo ErrHandler

intRef = 1
Set ref = References.AddFromFile("C:\Program Files\Common Files\MicroSoft Shared\VBA\VBA332.DLL")

intRef = 2
Set ref = References.AddFromFile("C:\Program Files\MicroSoft Office\Office\MSACC8.OLB")

intRef = 3
Set ref = References.AddFromFile("C:\Program Files\MicroSoft Office\Office\MSO97.OLB")

intRef = 4
Set ref = References.AddFromFile("C:\Program Files\Common Files\MicroSoft Shared\DAO\DAO360.DLL")

intRef = 5
Set ref = References.AddFromFile("C:\Program Files\MicroSoft Office\Office\MSPRJ9.OLB")

intRef = 6
Set ref = References.AddFromFile("C:\Program Files\MicroSoft Office\Office\EXCEL8.OLB")

Exit Sub

ErrHandler:
Select Case intRef
Case 1
ErrorMsg = "No VBA332"
Case 2
ErrorMsg = "No DAO360"
Case 3
ErrorMsg = "No MSACC8"
Case 4
ErrorMsg = "No MS097"
Case 5
ErrorMsg = "No MSPRJ9"
Case 6
ErrorMsg = "No EXCEL8"
End Select

MsgBox (ErrorMsg)

End Sub

' ***************************************

hth,
Wayne

 
Thanks Wayne! I really appreciate it! Have a star on the house! Please remember to give helpful posts the stars they deserve! This makes the post more visible to others in need![thumbsup]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top