Debug Error for TreeView variable definiton

suleymanera

New member
Local time
Today, 05:34
Joined
Jun 25, 2015
Messages
6
Hii

I am using Windows 8.1 64 bit system. Into attached access file (OfferStudy.accdb) ,trying to load an activeX TreeView control by defining into a form module.
First, I created an empty form and activeX Treeview control.When I define tv variable As TreeView as created in application, it is changing as Dim tv As treeView instead of TreeView. After my code is completed,an error message ("user-defined type not defined") is returning as shown in attached (DebugError.png)file.

I suppose that there is some conflict on creating activeX control on my Access 2013 application.

Any advice to fix this error will be very helpful form next step.

Thanks in advance.
 

Attachments

You haven't added the reference to the treeview library. This is the typical path:

C:\WINDOWS\SysWOW64\MSCOMCTL.OCX
 
I searched the MSCOMCTL.OCX in my PC. I found it into C:\Program Files\Microsoft Office 15\root\vfs\SystemX86.Copied and pasted into C:\Windows\SysWOW64 where received a message asked me for admin permission , but I selected continue button and copied the file into SystemX86.
After, I reboot the computer and run the access app. faced same problem.

I also tried to apply the steps given in an article as follow
-----------------------------------------------------------------------
64 bit Windows

The 64-bit steps are identical to the 32 bit version except the folder is SYSWOW64 rather than SYSTEM32:

  1. Unregister the new OCX file. Open an instance of the Windows Command Prompt, paste the following command, and press <Enter>:
    Regsvr32.exe /u C:\Windows\SYSWOW64\MSCOMCTL.OCX
  2. Make a backup of the OCX file C:\Windows\SYSWOW64\MSCOMCTL.OCX to C:\Windows\SYSWOW64\MSCOMCTL.bak
  3. Copy a legacy version of the MSCOMCTL.OCX file to your C:\Windows\SYSWOW64 folder. For your convenience, a zipped copy from 2011 is here (given a link)
  4. Register this legacy OCX file with the following command:
    Regsvr32.exe C:\Windows\SYSWOW64\MSCOMCTL.OCX
  5. Unregister this legacy version of the OCX file:
    Regsvr32.exe /u C:\Windows\SYSWOW64\MSCOMCTL.OCX
  6. Delete the legacy OCX file: C:\Windows\SYSWOW64\MSCOMCTL.OCX
  7. Rename the new OCX file we renamed in step 2, back to its original name:
    C:\Windows\SYSWOW64\MSCOMCTL.bak to C:\Windows\SYSWOW64\MSCOMCTL.OCX
  8. Re-register the new version of the OCX file. Paste the following command and press <Enter>:
    Regsvr32.exe C:\Windows\SYSWOW64\MSCOMCTL.OCX
  9. Reboot the computer.
  10. Open Microsoft Access and then retest the control. It should be working at this point.
---------------------------------------------------------------------------------
When I tried to register the MSCOMCTL.OCX file ,copied from the link given into the article, I received attached message.
 

Attachments

  • Mscomctl2.jpg
    Mscomctl2.jpg
    102.1 KB · Views: 166
At the end, I solve the problem. I registered the copied MSCOMCTL.OCX into C:\Windows\SysWOW64 and reboot the computer.
Open my Access 2013 file , deleted existing treeview control. After then I installed a new treeview control from activeX control option into the Ribbon panel.

It is working now...

Thanks and regards
 

Users who are viewing this thread

Back
Top Bottom