How to call Node Click in Procedure

Posted on 2002-05-28
Medium Priority
Last Modified: 2008-01-09
I want a solutions for Calling the NodeClick Function in some procedure.

I am using treeview control, i want to call NodeClick in other procedure, when i click on the node it automatically works but the problem is when i calling that NodeClick fucntion in some procedure i am unable to pass a node value.

tree structure

if possilbe plz tell me how to call nodeclick in some other procedure for "Child1"

eg :
Private Sub TreeMenu_NodeClick(ByVal Node As MSComctlLib.Node)
  msgbox "Hi"
end sub
Question by:GautamMukherjee
LVL 143

Accepted Solution

Guy Hengel [angelIII / a3] earned 600 total points
ID: 7038932
You have 2 situations:
* is Child1 the selected (active) node:
  Call TreeMenu_NodeClick(treeMenu.SelectedItem)

* otherwise, you have to get the reference to the node, either by key or by index:
  Call TreeMenu_NodeClick(treeMenu.Nodes(indexorkey))



Expert Comment

ID: 7039138
If your procedure is in a different module than the TreeMenu you must also change the NodeClick from Private to Public.

Hope this helps.
LVL 16

Expert Comment

ID: 7040099
"If your procedure is in a different module than the TreeMenu you must also change the NodeClick from
Private to Public.
sorry,... what?
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.


Expert Comment

ID: 7040127
Richie, I will clarify....

If you have a BAS module with a procedure in it...

Sub CallNodeClick()
    Call Form1.TreeView1_NodeClick(Form1.TreeView1.SelectedItem)
End Sub

This will not work...

Private Sub TreeView1_NodeClick(ByVal Node As MSComctlLib.Node)

This will...

Public Sub TreeView1_NodeClick(ByVal Node As MSComctlLib.Node)
LVL 16

Expert Comment

ID: 7040277
this is the first time i heard that :0

Author Comment

ID: 7046596
Thanx for the answer.


Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

589 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question