G
Guest
I have used treeviews in the past, both with Excel and Access, but I'm in the
relearning phase for using it with Access. Here's a very strange basic
problem I don't recall having before, so it really has me perplexed.
If I want to manipulate a treeview in a module or class module, I have to
declare the variable as a TreeView in order to get the critical properties
(like Nodes). But when I try to assign it to the actual treeview on a form,
VBA doesn't return the treeview as a TreeView type, but rather as a
CustomControl type, causing a type clash at runtime. But declaring the
variable as CustomControl doesn't let me use the TreeView properties from the
editor. Even if I try manipulating the TreeView in the actual treeview event
handler code, it recognizes the treeview by its name, but there are no
treeview-specific properties/methods available from the editor (although the
events seem to be there).
What I found is that if I go ahead and type out the Nodes (for example)
property, it actually binds at runtime if I use generic types (or just
pretend nothing's wrong in the event handler code). But this seems like a
bizarre misfit. In addition, all the resources I used to use on MSDN for
learning the treeview object seem gone (actually, the entire site seems shot,
or else it's just down for now), so flying blind without even the clues from
the editor is hard.
Am I doing something wrong here? I feel like I'm taking crazy pills... But
I've tried all the obvious stuff... I think... (comctrls is referenced, e.g.).
Thanks,
BnB
relearning phase for using it with Access. Here's a very strange basic
problem I don't recall having before, so it really has me perplexed.
If I want to manipulate a treeview in a module or class module, I have to
declare the variable as a TreeView in order to get the critical properties
(like Nodes). But when I try to assign it to the actual treeview on a form,
VBA doesn't return the treeview as a TreeView type, but rather as a
CustomControl type, causing a type clash at runtime. But declaring the
variable as CustomControl doesn't let me use the TreeView properties from the
editor. Even if I try manipulating the TreeView in the actual treeview event
handler code, it recognizes the treeview by its name, but there are no
treeview-specific properties/methods available from the editor (although the
events seem to be there).
What I found is that if I go ahead and type out the Nodes (for example)
property, it actually binds at runtime if I use generic types (or just
pretend nothing's wrong in the event handler code). But this seems like a
bizarre misfit. In addition, all the resources I used to use on MSDN for
learning the treeview object seem gone (actually, the entire site seems shot,
or else it's just down for now), so flying blind without even the clues from
the editor is hard.
Am I doing something wrong here? I feel like I'm taking crazy pills... But
I've tried all the obvious stuff... I think... (comctrls is referenced, e.g.).
Thanks,
BnB