How to update Tree View?

zokolus

New member
Local time
Today, 10:54
Joined
Feb 11, 2005
Messages
9
This problem is driving me crazy.... :mad:
I have main form which contains treeview control. TreeView contains list of all users that have been added. I add users in pop up form. But when I hit Update button in pop up form the treeview dosen`t want to update.
I can make it work only if I close main form and open it again when I hit Update button on pop up form.

If IsLoaded("frmOsnovnoOkno") Then
DoCmd.Close acForm, "frmOsnovnoOkno"
DoCmd.OpenForm "frmOsnovnoOkno"
DoCmd.Hourglass False
End If

I dont want to close main form ("frmOsnovnoOkno") and open it again I just want to update treeview without closing and opening main form. Please help me.. :)
 
You will probably need to call the code that loads the tree into your form originaly

Something like

Run Forms![frmOsnovnoOkno].loadtree()

HTH

Peter
 
I tried with:
1.) Run Forms![OsnovnoOkno].loadtree (CreateTree)

and with

2.) Run Forms![OsnovnoOkno].loadtree (CreateTree,sql,"xRoot")

but it didn`t worked.

First Access tells me "Variable not defined" for CreateTree, Second tells me "Variable not defined" for sql.

CreateTree is routine for load tree and sql is sentance which populate tree.

Any idea???
 
try
Run Forms![OsnovnoOkno].CreateTree()
 
If I try RUN Forms![frmOsnovnoOkno].CreateTree then Access tells me:"Application-defined or object-defined error".

But if I try RUN Forms![frmOsnovnoOkno].CreateTree (sql) then Access minimaze my form and freezes Access. :confused:
 
I have not used TreeView much but if you paste the code behind CreateTree I will see if I can workout what is happening for you.

Peter
 
I thought I would have a look at a recent project I compiled recently, and suprise, suprise, my code line is:

If IsLoaded("frmProducts") Then
Docmd.Echo False
DoCmd.RunCommand acCmdSaveRecord
DoCmd.Close acForm, "frmProducts"
DoCmd.OpenForm "frmProducts"
Docmd.Echo True
DoCmd.Close acForm, Me.Name
End If

The Echo line stops the screen updating, thus stops the form appearing to close, then open.

HTH

Dave
 

Users who are viewing this thread

Back
Top Bottom