Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / ActiveX Controls / November 2004

Tip: Looking for answers? Try searching our database.

Treeview Control Roadblock

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Erika - 04 Oct 2004 22:06 GMT
I have a treeview control that breaks in the code when I try to
populate it with parent nodes. It stops with the very first node and
either gives me a "type mismatch" or a "key is not unique in
collection" error. The line of code it stops on is this one:

   Set nod = objTree.Nodes.Add(, tvwLast, strRootKey, strTaskType, 0)

(strrootkey = "Root " and then a unique task name)
(strtasktype = the unique task name)

This code and control worked in my MS Access 97 version of my program.
I am currently rebuilding it in MS Access 2003 and have hit this wall.
I have set all the properties that same (as far as I know) in the
properties window and the TreeCtrl Properties (double click) window. I
have printed out the parameters for the object.add method from MSDN.
They look correct to me.

Please tell me what I'm doing wrong. If I've omitted any data that
would be helpful, please tell me and I'll add more. Thank you in
advance for your help.
Alex Dybenko - 05 Oct 2004 07:05 GMT
Erika,
can't say for sure what can be the problem as i don't see the whole thing.
but try to check that nod is declared as comctl.node or mscomctl.node (could
be other node objects from other libraries)
then last argument - 0 - try to omit it.
also check that you dont have references to both common controls 5 and 6
library, use only one

Signature

Alex Dybenko (MVP)
http://Alex.Dybenko.com
http://www.PointLtd.com

>I have a treeview control that breaks in the code when I try to
> populate it with parent nodes. It stops with the very first node and
[quoted text clipped - 16 lines]
> would be helpful, please tell me and I'll add more. Thank you in
> advance for your help.
Erika - 05 Oct 2004 19:58 GMT
Thank you so much, Alex, the mscomctl.node change did the trick!

> Erika,
> can't say for sure what can be the problem as i don't see the whole thing.
[quoted text clipped - 3 lines]
> also check that you dont have references to both common controls 5 and 6
> library, use only one
bobo - 28 Nov 2004 08:49 GMT
> I have a treeview control that breaks in the code when I try to
> populate it with parent nodes. It stops with the very first node and
[quoted text clipped - 16 lines]
> would be helpful, please tell me and I'll add more. Thank you in
> advance for your help.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.