SubForm Refresh Delay Problem

cheer

Registered User.
Local time
Today, 16:37
Joined
Oct 30, 2009
Messages
222
Created one main form contains a SubForm inside. There is two buttons on the main form, indicated by
a) Save button
b) Refresh button

This button will insert data through the insert SQL string into seperate MS Access but under the same server before the data is displayed on the SubForm.

Question:
Why I need to click the Refresh button 2 to 3 times in order to obtain the latest info ? Below is my code

Private Sub RefreshSubForm()
DoCmd.Requery ("SubForm_V_QATransaction")
Me.Refresh
Me!SubForm_V_QATransaction.Form.Refresh
Me!SubForm_V_QATransaction.Form.Filter = "StartDate Is Null or EndDate Is Null"
Me!SubForm_V_QATransaction.Form.FilterOn = True
End Sub

Any chance not to allow the few clicks exercise, on the other hand, type in few VBA codes to act as timer for delay purpose like DoEvents for example .

(Tried before the DoEvents method, however, result remain the same)
 
in a mainform just use

subdetails.form.requery

i think thats the syntax - where subdetaisl is the name of the subformcontrol on the mainform.
 
Delay means the syntax you write is correct, because the subform still able to show the data, it is still matter of time. Thus, nothing to do with the syntax.

We need to consider other factors/issues like network, RAM, cache, etc

As for my case, after several of R&D, it is due to the cache. My solution is simple with one code as shown below

DBEngine.Idle dbRefreshCache
Me!SubForm_Production_Schedule.Requery
 

Users who are viewing this thread

Back
Top Bottom