We help IT Professionals succeed at work.

missing or broken reference to the file mscomct2.ocx version 2.0

gtmathewDallas
on
Medium Priority
14,245 Views
Last Modified: 2014-06-23
Hi Experts,
When I run my application(msaccess 2010) its showing the error "missing or broken reference to the file mscomct2.ocx version 2.0"
Actually it has to use by different users in different computers ( all are using same version - msacces 2010) - But some of of the computers/laptop showing the above error, but some of them not.
Its working good in my desktop.
The file is shared through network.
Please help
Thanks
Comment
Watch Question

Author

Commented:
Or somebody please help how to register the file mscomct2.ocx
Scott McDaniel (EE MVE )Infotrakker Software
CERTIFIED EXPERT
Most Valuable Expert 2012
Top Expert 2014
Commented:
First: Are you sure you need that reference? That file contains several controls, like the TabStrip, Toolbar, Treeview, etc. Are you using any of those controls?

You can test to see if you need the reference by doing this:

1. Make a backup of your database
2. Open the database, then open the VBA Editor.
3. Click Debug - Compile. Fix any errors, and continue doing this until the menuitem is disabled
4. Click Tools - References. Find and uncheck the reference to mscomct2.ocx.
5. Debug - Compile again.

If you don't have any errors on step #5, then chances are you don't need the reference.

If you find you do, then you'll have to deploy the files needed to the machines and then "register" it on the machines. Note you must have a valid license to do this, which means you need a copy of VB5/6, or one of the developer versions of Access in order to do this.

To register it, deploy to the correct folder on the target machine and then use RegSvr32 to register. This article gives more details:

http://www.accessmvp.com/djsteele/AccessReferenceErrors.html
Database Architect / Application Developer
CERTIFIED EXPERT
Top Expert 2007
Commented:
That is is now at this location:

WOW
CERTIFIED EXPERT
Top Expert 2009

Commented:
If you were using this control to create Browse dialogs, this can be done with the Office FileDialog object.  Here is some standard code for this purpose:
Public Function SelectFile() As String
'Requires Office XP (2002) or higher
'Requires a reference to the Microsoft Office Object Library
'Created by Helen Feddema 3-Aug-2009
'Last modified 3-Aug-2009

On Error GoTo ErrorHandler

   Dim fd As Office.FileDialog
   Dim varSelectedItem As Variant
   Dim strFileNameAndPath As String
   
   'Create a FileDialog object as a File Picker dialog box.
   Set fd = Application.FileDialog(msoFileDialogFilePicker)
   
   With fd
      'Set AllowMultiSelect to True to allow selection of multiple files
      .AllowMultiSelect = False
      .Title = "Browse for File"
      .ButtonName = "Select"
      .Filters.Clear
      'Modify filters as needed
      .Filters.Add "Documents", "*.doc; *.txt", 1
      .InitialView = msoFileDialogViewDetails
      If .Show = -1 Then
         'Get selected item in the FileDialogSelectedItems collection
         For Each varSelectedItem In .SelectedItems
            strFileNameAndPath = CStr(varSelectedItem)
         Next varSelectedItem
      Else
         Debug.Print "User pressed Cancel"
         strFileNameAndPath = ""
      End If
   End With
   
   SelectFile = strFileNameAndPath
   
ErrorHandlerExit:
   Set fd = Nothing
   Exit Function

ErrorHandler:
   MsgBox "Error No: " & Err.Number _
      & " in SelectFile procedure; " _
      & "Description: " & Err.Description
   Resume ErrorHandlerExit

End Function

Open in new window

Author

Commented:
@ Scott McDaniel I complied and fixed some errors as you told now its showing "There is no object in this control"
And it seems to all form controls are working except calendar control.
Please help
Thanks
Scott McDaniel (EE MVE )Infotrakker Software
CERTIFIED EXPERT
Most Valuable Expert 2012
Top Expert 2014

Commented:
As the second part of my earlier post indicates, you must deploy the required files to the end user machine. In most cases, that's just the mscomctl2.ocx file, but you must be sure to deploy the correct version for the end user platform.

Also refer to the link from MVP Doug Steele regarding references and OCX files - you'll find some very good information there.
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Application Developer
CERTIFIED EXPERT
Top Expert 2007

Commented:
" working except calendar control. "
The Calendar control is a separate OCX and is longer part of the mix (as of A2010 or maybe A2007). This was replaced by the built-in Calendar that is accessible in any text or combo box. Whereas technically you could ... still you MSCAL.OCX ... I would suggest not doing so.  But ... if you get that OCX from an earlier version of Access (eg A2003), you can put it in the same folder as your app and just set a Reference to in in VBA.

mx

Author

Commented:
Yes it is working, In the beginning I placed the ocx file wrongly (in SYS) and now changed to SysWOW64
Thanks DatabaseMX (Joe Anderson - Access MVP) and Scott McDaniel.
Thank you Helen_Feddema.
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Application Developer
CERTIFIED EXPERT
Top Expert 2007

Commented:
So the entire issue was where the OCX was located ?

Author

Commented:
No, it was just one of the issue which accidentally happen while I am solving the problem as Scott McDaniel specified.. Thanks again...