Link to home
Start Free TrialLog in
Avatar of hwr734s
hwr734s

asked on

Access ADP subform refreshes / fickers as many times as rows in the datasheet it contains

I have a main form and a subform. In the OPEN event for the subform the code  below is executed.  The subform displays the results in datasheet format. There are no Master / Child links. The LogonID stored on a hidden & minimized form is used to retreive the rows in the SavedActivity table. The stored procedure has 1 parameter, @UserID, which is the primary key for the table.

The resulting recordset produces exactly what I want; but when the focus is placed on the subform when a staffer clicks on any  row on the subform, the datasheet in the subform "flickers / refreshes" about as many times as the number of rows returned.  This "refresh" happens only the first time any row is clicked on or the scroll bar moved. After a staffer posts the updated row, then the problems reoccurs again.

The "refreshs" can take a long time to finish compared to the 1 - 2 second time it takes for the form to display the results.  I do not invoke any refresh / requery / repaint methods.

I have tried playing with every setting I could find, but I  don't know causes the problem or how to fix it.

Could someone please help?
 
   Dim strParm As String
   strParm = "Execute  stpSavedActivity_ByID  '" & Forms![frmSetup01]![LogonID] & "'"
  Me.RecordSource = strParm

ASKER CERTIFIED SOLUTION
Avatar of Leigh Purvis
Leigh Purvis
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
LPurvis,

Could this have anything to do with one of the "Advanced" "Interval" setting being set to low?
Refresh Interval
ODBC Refresh Interval
(Either one of these being set to 1 or Zero)

Forcing Access to "Refresh" too soon/often?
I wouldn't have expected so to be honest.

You can check the OLE timeout and the refresh interval (any ODBC settings will - or at least should - be absent in an ADP).  But I don't think they'd affect the ADP's normal use. (They should be the normal sort of 30/60 seconds... worth a quick check of course).
But for this to be happening only on entering the subform - doesn't sound like a constant interval problem as such.

It looks like this might become a "no feedback" type question - but I'd certainly wonder about the other methods of assigning the source for now.

And if there really is no refresh/requery code - then I wonder what happens if you actually put some in?
It does it - but still visibly requeries upon entry again?
Avatar of hwr734s
hwr734s

ASKER

Sorry I did not respond sooner. A co-worker resigned and I had to work on transitioning his work to me.

I did try  your suggestions, but with mixed results.

I was so frustrated, I decided to make a copy of the file and start over.  I deleted ALL events on the main form and subform and added one event back at a time. When I got it to work properly, I compared the two  VBA event files.

The culprit turned out to be the "Enter" event on main form. Some input parameters on the  properties sheet  left over from my multiple attemps to pass the parameters to the stored proceedure caused the subform to  refilter the data again when the subform datasheet got the focus.

I can not even find an "Enter" event on any properties sheet, but it showed up in the VBA editor.

A check in HELP on "Events" turned up this: "Because the Enter event occurs before the focus moves to a particular control, ..."; so i presume that after processing  the "Execute  stpSavedActivitySelected  '" & Forms![frmSetup01]![LogonID] & "' , 'T' "  when the update button on the main form was pressed, a second query was triggered by the "Input parameters"  data.

Again, I apologize for the tardy response.
In summary, either the:
        Me.InputParameters = "'" & Forms![frmSetup01]![LogonID] & "'"
        Me.RecordSource = "stpSavedActivity_ByID"
OR
       strParm = "Execute  stpSavedActivity_ByID  '" & Forms![frmSetup01]![LogonID] & "'"
        Me.RecordSource = strParm

would have worked alone, but not the two together.; which is in essence is what I had by the Data tab "Input Parameters" variables coded.

I am awarding you the points, and appreciate your help





Enter is an event of the subform control itself - rather than the underlying form acting as a subform.
(On the parent form the subform control has only two events - Enter and Exit - as well as the plethora that exist for the form itself.)

Ultimately - it was something firing in one of the events as the subform receives focus.  (Just not where you expected ;-)
Which is reassuring as the first thing that iccurs in such a situation.

Glad you're sorted.

(P.S. Any of the suggested methods should work well by themselves under normal circumstances)