0

Possible Duplicate:
MS-access doesn't catch treeview events after win sec-update

recently an error appeared with a Treeview element in my access form.

The expression Expand you entered as the event property setting produced the following error: There was an error laoding an ActiveX control on one of your forms or reports.

When I click "OK" (only opportunity) the next error appears (Expand is replaced by MouseMove, MouseDown/Up, DblClick etc.), when I press Keys the KeyDown/Up/Press Message appears etc. When I interact with the TreeView then the "Expand" is replaced by e.g. NodeClick or Collapse. Every message only appears once, when I performed every possible Event no message pops up - but the treeview doesnt work, it doesnt open any form (the treeview is used as a menu).

The mysterious thing to me is - last week those Access Databases all worked fine - we have a database for every customer (frontend and data together) and now suddenly every database 'crashes'. I assumed that the ActiveX Treeview Control was changed by a Windows Update or something similar but also an old WinXP laptop throws the same error messages. Even a database that hasnt been opened for 2 weeks and definitely worked back then doesnt work anymore. So from my point of view there cant be anything in the code that is wrong.

Nevertheless I tried to set a breakpoint in the Form_Load event, but the Expand Error already pops up before the first line of OnLoad is executed. The OnLoad Event is the only event that is specified (GUI says "Event Procedure", its VBA Code only) and all other fields are blank (and no code specified). I created a blank VBA for e.g. MouseMove, but the error still appears.

What is this error and where does it come from? Hope anyone can help.

Regards,

Matthias

P.S.: My Treeview Project Via this Link you find the files for a treeview project in MS Access (mentioned in the first answer). When I download these files the same kinds of error appear.. so it definitly has to do with the activeX controls, right? Is there anybody where these files work, and if so - why? Hope anybody can help..

Community
  • 1
  • 1
Matthias S
  • 3,358
  • 3
  • 21
  • 31
  • Please see another question on this topic: http://stackoverflow.com/questions/11984274/ms-access-doesnt-catch-treeview-events-after-win-sec-update – HK1 Aug 20 '12 at 14:09

2 Answers2

1

I was having the same problem - treeview worked last week not today in either 2007 or 2010 Access, multiple PCs. Problem was Windows update. (See link http://support.microsoft.com/kb/2687441). I created and ran the batch file as indicated in the kb article and my Treeview now works.

C Roberts
  • 26
  • 1
0

I got the same error. I found the solution in the following link: http://mymsaccessblog.blogspot.nl/2008/09/my-teeview-project-episode-5-using.html

I added the following sub listed below and adjusted it with the key I used and it worked. I hope this helps you as well. Sorry if the formatting is not good. First time I post anything

Private Sub xProductTreeview_Click()

Dim nodSelected As MSComctlLib.Node ' a variable for the currently selected node

Set nodSelected = Me.xProductTreeview.SelectedItem ' get the currently selected node

If nodSelected.Key Like "Prod=*" Then ' are we on a product node
ElseIf nodSelected.Key Like "Cat=*" Then ' are we on a category node
Else ' somehow this is neither a category or product node
End If

End Sub

Lucas
  • 1
  • Unfortunately this didnt help - I also think that the code is not the problem since it worked 2 weeks ago and without any change (in the code) it isnt working anymore. – Matthias S Aug 20 '12 at 14:42