Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

refresh all open forms

Posted on 2004-09-07
5
Medium Priority
?
389 Views
Last Modified: 2012-06-27
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
Comment
Question by:silsuba
  • 3
  • 2
5 Comments
 
LVL 41

Accepted Solution

by:
shanesuebsahakarn earned 1000 total points
ID: 12000747
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
 

Author Comment

by:silsuba
ID: 12001097
shane;

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

0
 

Author Comment

by:silsuba
ID: 12001143
Ok.. I got it..  

For Each frm in Forms ..

Works so far.. thanks!
0
 
LVL 41

Expert Comment

by:shanesuebsahakarn
ID: 12001152
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
 
LVL 41

Expert Comment

by:shanesuebsahakarn
ID: 12001154
OK, if that fixes it, that's even better :)
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
Windows Explorer lets you open cabinet (cab) files like any other folder. In VBA you can easily handle normal files and folders, but opening and indeed creating cabinet files takes a lot more - and that's you'll find here.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question