Hello,
I am trying to create a context menu for right clicking on a TreeView control (for deleting, etc...), using either the MouseDown or MouseUp event. When I put following code in: - Private Sub TestTree_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
-
If Button = acRightButton Then MsgBox ""
-
End Sub
-
I get an error message when I try to open the form with the TreeView on it:
"The expression On Open you entered as the event property setting produced the following error: Prodcedure declaration does not match description of event or procedure having the same name"
I have nothing in the form's On Open event. If I remove the mousedown sub from the code, everything compiles fine. Any ideas?
6 7207
Hello.
I have no problem to run the handler in my form.
Have you checked Form.OnOpen property?
Additionally that type of errors is usually caused by inappropriate functions/subs/global variables declarations.
Sometimes it really appears without any reason and goes away without any obvious reason too. ;)
Sometimes only full form rebuild helps. ;)
Regards,
Fish
P.S. A stupid question - are you sure TestTree is the name of TreeView object, not the name of the form control embedding this object?
Hello.
I have no problem to run the handler in my form.
Have you checked Form.OnOpen property?
Additionally that type of errors is usually caused by inappropriate functions/subs/global variables declarations.
Sometimes it really appears without any reason and goes away without any obvious reason too. ;)
Sometimes only full form rebuild helps. ;)
Regards,
Fish
P.S. A stupid question - are you sure TestTree is the name of TreeView object, not the name of the form control embedding this object?
The Form.OnOpen property = "[Event Procedure]". I forgot that there is a call to a sub there to populate the tree. The sub runs fine if I don't have the Mousdown handler in the form's code.
TestTree is the name of the object - I tested this by defining handlers for the object's dblClick event. I will try to rebuild the form and report the results.
The Form.OnOpen property = "[Event Procedure]". I forgot that there is a call to a sub there to populate the tree. The sub runs fine if I don't have the Mousdown handler in the form's code.
TestTree is the name of the object - I tested this by defining handlers for the object's dblClick event. I will try to rebuild the form and report the results.
Rebuilt - same problem. Added TreeView 6.0 control to a blank form. The only code I put in the module was the MouseDown handler - I get the same error except that instead of referring to On Open, it refers to On MouseMove. I tried to check the control's OnMouseDown property and I get "Object doesn't support this property or method." Same if I try to set the OnMouseDown property. This also happens when I try MouseUp. DblClick works, but I really need something that returns which mousebutton is clicked.
Dumb question, but you're using VBA in Access right?
Rebuilt - same problem. Added TreeView 6.0 control to a blank form. The only code I put in the module was the MouseDown handler - I get the same error except that instead of referring to On Open, it refers to On MouseMove. I tried to check the control's OnMouseDown property and I get "Object doesn't support this property or method." Same if I try to set the OnMouseDown property. This also happens when I try MouseUp. DblClick works, but I really need something that returns which mousebutton is clicked.
Dumb question, but you're using VBA in Access right?
Sure I talk about VBA in Access.Form module.
I have a little doubt as for event handler sub declaration.
In you code it goes without argument pass type qualifier, so assumed by default as ByRef. - Private Sub TestTree_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
-
If Button = acRightButton Then MsgBox ""
-
End Sub
-
In my code arguments are being passed ByVal. -
Private Sub trvGroupsTree_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Long, ByVal y As Long)
-
If Button = acRightButton Then MsgBox ""
-
End Sub
-
Thank You. It didn't work at first, but then I rebuilt the form w/ just the MouseDown handler (with ByVal qualifiers) and that worked. Then, I slowly copied code and controls from my old form. It appears to be working. Still very strange. I've got essentially identical forms with identical code modules and controls - one works and one doesn't. Weird. Thanks for your help!
:)
You are welcome.
Regards,
Fish
P.S. I think some our experts known to launch S-300 rocket every time they here about using ActiveX in Access will be happy to have one more example of Fatal Error Produced By ActiveXXX.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Plumer |
last post by:
Hello everyone,
I am using MS .NET Framework 1.0 Version 1.0.3705 developing a C# client
application using SQL Server on the server side.
I am looking to implement drag & drop in a TreeView...
|
by: Jürgen Müllder |
last post by:
Hi!
I have a TreeView in my Application. I have the MouseDown Attached to the
TreeView. When i click at a Node it makes that what it should. But when i
Expand a Node by clicking at the Plus Sign...
|
by: Michael C |
last post by:
Hi all,
I half-resolved my previous TreeView issue. Now I was wondering if anyone
knows of a way to keep a TreeNode from being highlighted when it is
left-clicked? It seems like there should...
|
by: Marc Jennings |
last post by:
Hi
There is probably a very simple answer to this, but I am not too
familiar with the treeView control...
I have a treeview control, populated from a database. I want to be
able to get the...
|
by: vijaynats |
last post by:
I have a treeview with a ContextMenu attached. When i click on a node,
AfterSelect fires but does not fire when right clicked (the context
menu pops up).
(Background: I have loaded a list of...
|
by: Aleksey |
last post by:
Hi, All!
I have a problem with TreeView component. My TreeView consists of two
nodes Node1 and Node2. On click of right mouse button TreeView has event. In
this event I check wich node is...
|
by: A-PK |
last post by:
Hi,
I am using treeview as my menu.
my menu is like the following
+ Users & Groups
- Users
-Groups
+ Departmenuts
- Engineering
|
by: Gary Dunne |
last post by:
I'm writing an app that requires drag and drop operation between a ListView
and a TreeView control. (The source is the ListView). During the drag drop
operation I want to be able to detect the...
|
by: Andrew Ducker |
last post by:
I have a treeview linked to a series of panels, making the correct
panel visible depending on which node is selected.
I now want to check that the user is allowed to leave the current node...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
| |