Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How can I refresh a form without refreshing the subforms that are contained on it?

Posted on 2009-04-12
5
Medium Priority
?
210 Views
Last Modified: 2013-11-28
Hi experts,

Is it possible to refresh a form without refreshing the subforms contained on it?  Basically, when I requery or refresh my form the subforms blink once as if they are refreshing.  I do not need this to happen as the subforms are only on there for extra information and not part of the same record, i.e. the subform information is static and the recordsource is from another table. Please could somebody help me to not refresh these subforms?  

At the moment, on my form that has the subforms on it, I click a button to refresh the data on the form, in effect this refresh saves the data to the table.  When I click this button the subforms blink as if they are updating, but this is not required.

I have tried both me.refresh and me.requiry but neither have stopped the subforms from blinking once.

Any help would be gratefully received. Thank you.

Regards,
Terry
0
Comment
Question by:TerenceHewett
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 85
ID: 24126734
This is default behavior, and you really cannot tell Access to ignore the subforms. You can, however, "lock" the screen so it doesn't update until you tell it to. Use this:

In the General Declarations section of a standard Module (i.e. not a Form module):

Declare Function LockWindowUpdate Lib "user32" (ByVal hWnd As Long) As Long

Now, anywhere you need to turn screen updating off:

LockWindowUpdate Me.hwnd

To turn it back on:

LockWindowUpdate 0
0
 

Author Comment

by:TerenceHewett
ID: 24127203
Thanks LSM for the code above.  I think this is exactly what I need but I have tried this code in the OnOpen, OnLoad, OnCurrent events of the form and I still have the same issue.  I did put the Declare... code into the General Declarations of a standard module.

Any ideas where this code should be executed?

Thank you again.

Terry
0
 
LVL 85

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 2000 total points
ID: 24128833
You would usse this just before you requery:

LockWindowUpdate Me.Hwnd
<do your requery>
UnlockWindowUpdate 0
0
 

Author Comment

by:TerenceHewett
ID: 24129615
LSM, you are a genius - thank you very much - this has resolved my problem.

Best regards

Terry
0
 

Author Closing Comment

by:TerenceHewett
ID: 31569354
Sorry LSM, thought I had accepted this solution.  

Best regards
Terry
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
Explore the ways to Unlock VBA Project Password Excel 2010 & 2013 documents. Go through the article and perform the steps carefully to remove VBA Excel .xls file.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

597 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