Delay In Reflecting Data Into SubForm

cheer

Registered User.
Local time
Tomorrow, 06:42
Joined
Oct 30, 2009
Messages
222
A system is built by using the MS Access 2000.

Inside a main form, there is one subform, one SAVE button, one REFRESH button and one text box. When a value is keyed into the text box, user will press SAVE button and theoretically, subform should reflect the immediate result with latest info in the subform (currently it takes 3 to 4 seconds to display the result)

Part of the written VBA under the button SAVE click event as below
Me!SubForm_V_QATransaction.Form.Requery
Me!SubForm_V_QATransaction.Form.Refresh


My questions are below:-

a) How to resolve the delay, means, the committed result should appear in subform immediately after a data is successfully committed into a table.

b) Even I have included VBA code like Me.Refresh, Me.Repaint, Me.Requery, all are helpless. If a data can be displayed instantly , my plan is to remove the REFRESH button to avoid few tries .

Any advice ?
 
I notice something today, after the button SAVE is pressed and immediately I click on the SubForm, SubForm will show the latest info.

Can anyone suggest something why this happen and how can I set the cursor focus onto the SubForm ?
 
I am solving my problem with below temporary codes which I think is not the professional way

Dim intLoop As Integer

For intLoop = 1 To 250
Me!SubForm_V_QATransaction.Form.Filter = "StartDate Is Null or EndDate Is Null"
Me!SubForm_V_QATransaction.Form.FilterOn = True
Me!SubForm_V_QATransaction.Form.Requery
DoEvents
Next intLoop

Anyone can advise a better way ?
 
After few tries, with the few right combination of codes and in right sequence, my SubForm is working fine now .Share my finding in case some of you face the same problem in the MS Access 2000.

Me.Requery
Me!SubForm_V_QATransaction.Form.Requery
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
 

Users who are viewing this thread

Back
Top Bottom