• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 391
  • Last Modified:

refresh all open forms

Hi All!

In a project, I have several forms and at any one time two or more forms can be open. Is there a simple method for refreshing the data on all open forms?

Thanks!
0
silsuba
Asked:
silsuba
  • 3
  • 2
1 Solution
 
shanesuebsahakarnCommented:
Dim frm As Form

For Each frm In CurrentDb.Forms
   frm.Refresh 'Or use frm.Requery, but this will return the form to the first record. It is required to show newly added records
Next
0
 
silsubaAuthor Commented:
shane;

Looks good, however when I run I get a method or data member found error on the .Forms

0
 
silsubaAuthor Commented:
Ok.. I got it..  

For Each frm in Forms ..

Works so far.. thanks!
0
 
shanesuebsahakarnCommented:
Hmm, is this an ADP?

Try this:

Dim frm As Object
For Each frm In CurrentProject.AllForms
   If SysCmd(acSysCmdGetObjectState,acForm,frm.Name)<>0 Then frm.Refresh
Next

Does that work?
0
 
shanesuebsahakarnCommented:
OK, if that fixes it, that's even better :)
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now