Unexpected event order with treeview control & subform

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi all
Sorry about the previous failed cross-post!

I wonder if someone can think of a solution here:

Using Access XP

I have a form containing a subform and a treeview control.

I have code to respond to the tvcontrol NodeClick event by displaying the
data relevant to the node in the subform.

I also have code responding to the OnExit events of the subform's contols
(text & combo boxes) such that changes made are committed to the database.

Problem is: the tvcontrol's NodeClick event fires BEFORE the OnExit event
when a new node is clicked while the cursor is in one of the subform's
controls - which I didn't expect - hence the changes are made to the data
underlying the new node, insted of the intended one.

Ideas (including a fundamentally new approach)?

Thanks for any time you may spend thinking about this.

Ali
 
Have you tried the LostFocus event of the subform? That should fire before
the NodeClick Event of the TreeView.
 
AliKwok said:
Hi all
Sorry about the previous failed cross-post!

I wonder if someone can think of a solution here:

Using Access XP

I have a form containing a subform and a treeview control.

I have code to respond to the tvcontrol NodeClick event by displaying the
data relevant to the node in the subform.

I also have code responding to the OnExit events of the subform's contols
(text & combo boxes) such that changes made are committed to the database.

Problem is: the tvcontrol's NodeClick event fires BEFORE the OnExit event
when a new node is clicked while the cursor is in one of the subform's
controls - which I didn't expect - hence the changes are made to the data
underlying the new node, insted of the intended one.

Ideas (including a fundamentally new approach)?

Thanks for any time you may spend thinking about this.

Ali
 
Hi,

In the treeview node even, you might try issuing a .refresh on the sub-form

- something like : me!subformcontrolname.form.refresh

Chris
 
Back
Top