Full Version: how to requery a treeview
UtterAccess Forums > Microsoft® Access > Access Forms
IainIOW
Would anyone know how to requery a treeview control to reflect the current state of a database?
My treeview opens with the database and its children are items taken from a table. can i requery the treeview to update its children when database changes are made on my forms?
For example, project name is shown on the treeview. If the name is changed in the database, the treeview will not show the changes until i go in to design view and then back in to live view. i am hoping to tage some code on to my fields that update automatically.
I have tired [New Form]![treeview0].requery - with no success so far!
any ideas?
Many thanks
argeedblu
I don't believe that treeviews have a simply requery method.
How did you populate the treeview in the first place? Running the same populate code again, triggered by the form's update event, would effectively requery the treeview.
Glenn
IainIOW
i used an onload event and built the tree using VB, i guess running would be the only option - i shall give it a try!!
Thanks
iain
argeedblu
Iain,
You could transfer the portion of the code that populates the treeview to a separate procedure and then call that code from the onload and afterupdate events of the form. I found the other day that I could also call one event procedure from another provided that all of the called procedure should be repeated when the other event occurs.
Glenn
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.