Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to update all open forms? 2

Status
Not open for further replies.

sabavno

Programmer
Jul 25, 2002
381
CA
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
 
Hi

You can only requery the open forms, so it is the forms collection you need to iterate through,

but this seems an heavy way to do it, why not put requery in the ongotfocus event of your record picker form? Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
UK
kenneth.reaySPAMNOT@talk21.com
remove SPAMNOT to use
 
on activate event in the form with listbox insert this code

On Error GoTo Err_REFRESH_Click
DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70

Exit_REFRESH_Click:
Exit Sub

Err_REFRESH_Click:
MsgBox Err.Description
Resume Exit_REFRESH_Click
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top