"Compile error...Can't find project or library"

S

SHIPP

I have written a database in Access 97 that splits itself into 50
sub-databases. These I then distribute around the U.S. to various facilities.
I have just sent out the first 10 sub-databases. There is one facility that
is having a problem. When the manager opens the database on his machine and
the following code runs it creates an error message "Compile error...can't
find project or library". The line that is highlighted is Public Sub
NewToolBar(). However, when I clock onto their server and open the database
there aren't any problems. It opens and works just as it should. Therefore I
don't think it can be the references. Are there any other ideas on what could
be causing this problem. Any help would be appreciated. I have also had my
superior clock onto the database and it opens fine for her and works just as
it should. Could it be that he is missing a library that creates toolbars and
if so does anyone know what it is and where it should be located?

Public Sub NewToolBar()


'***************************************************************************************
'* PROGRAM : HRP
'* CREATED : 03/20/05
'* COMMENTS : Closes the print preview
'* PARAMETERS: -
'* RETURNS : -
'* CALLED BY :
'* MODIFIED :

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

On Error GoTo HandleErr
Const cstrProcName As String = "modCreateCommandBar - btnClose"

Dim cbrCommandBar As CommandBar
Dim cbcCommandBarButton As CommandBarButton

' Add the command bar to the application's
' CommandBars collection.
Set cbrCommandBar = Application.CommandBars.Add
cbrCommandBar.Name = "HRPCommandBar"

' Add command button control to the control's
' collection of CommandBar objects.
With cbrCommandBar.Controls
Set cbcCommandBarButton = _
.Add(msoControlButton)
' Set properties of the command button.
With cbcCommandBarButton
.Style = msoButtonIconAndCaption
.Caption = "Print"
.FaceId = 19
.TooltipText = "Click here to print the report."
.OnAction = "PrintReport"
.Tag = "btnPrint"
End With
Set cbcCommandBarButton = _
.Add(msoControlButton)
' Set properties of the command button.
With cbcCommandBarButton
.Style = msoButtonIconAndCaption
.Caption = "Close"
.FaceId = 19
.TooltipText = "Click here to close."
.OnAction = "btnClose"
.Tag = "btnClose"
End With
End With
cbrCommandBar.Visible = True
cbrCommandBar.Position = msoBarTop
Set cbrCommandBar = CommandBars("HRPCommandBar")
With cbrCommandBar
.RowIndex = 1
.Left = 140
End With

ExitHere:
Exit Sub

HandleErr:
Select Case Err.Number
Case Else
MsgBox "Error " & Err.Number & ": " & Err.Description, vbCritical,
cstrProcName
End Select

End Sub
 
A

Alex Dybenko

Hi,
You have to be sure that you have reference to Microsoft Office 8 library,
and if you have reference(s) to something else then Access, VBA and DAO (and
office of course) - you have to distribute these libraries with your
application.
 
S

SHIPP

Although I'm a decent programmer I am naive to distributing libraries. Where
would they be? What are their names? and Where do I copy them to?
 
S

SHIPP

Although I'm a decent programmer I don't know anything about distributing
libraries. Where are they located? What are their names? and Where do I copy
them to?
 
A

Alex Dybenko

Open any module and run menu tools-options. see what references listed
there. if you are not sure which one you need - try to post a list here
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top