how to update all open forms?

polina

Registered User.
Local time
Today, 22:26
Joined
Aug 21, 2002
Messages
100
I have this problem

My form has a huge listbox that contains many records. By double clicking the appropriate row (record) on that listbox, user opens that record in another separate form. The form with the listbox statys open as well.
So, user makes changes to that record, closes form, and returns to the form with the listbox. What I want to do is that the form with the listbox would get updated when the user comes back to it.

Is it possible, by closing the record-modification form, update all the open forms (because I wouldn't know the name of the form with listbox, I have so many of them from where the record modification form may be open)

I tried this on my record-modification form:

Private Sub Form_Unload(Cancel As Integer)

For Each frm In Application.Forms
frm.Requery
Next frm

End Sub

But it doesn't work

Please suggest anything else
 
Not real sure of the "correctness" but you could add the me.refresh to the On_Activate event of all original forms. Thus when focus returns to the form, the data will be current.


However, this could cause a prob if you use the Dirty property/event.

Just a thought.

Brad.
 

Users who are viewing this thread

Back
Top Bottom