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
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