The app is very basic as I have little experience with the design environment. I don't think I'm doing buffering or transactions but if one of those is a default when one adds a grid to a form I might be.
There is a free table, Inputs, which is the RecordSource (RecordSourceType 1) for the grid. Inputs stores information about time based data stored in a second free table, Detail. The function of the app is to allow the selection of one or more sets of time based data for reporting or plotting. The AdjRange procedure that gets called from the grid checkbox.valid event determines the range via "SELECT Min(BegStamp), MAX(EndStamp) FROM Inputs WHERE selected..." If the results are null the routine disables the elements on the form that only make sense when something is selected. When the results are not null the values are written to the form Report range variables which are used as the earliest and latest calendar time that can be selected for output. The AdjRange procedure does not make any changes to the Inputs table at this time. In the future I want to have the system automatically allow only data that shares time stamps to be selected. This will probably involve adding a filter. I initially was writing the scan results to a cursor. I got suspicious that maybe VFP was making invalid assumptions and reusing the results of a previous scan. I changed to writing to an array and things seem to be working better. Typical sequence: - Nothing is selected in the grid and the controls disabled - Clicking on a grid selection checkbox results in the controls come alive with the correct data - Clicking the same checkbox again and everything goes to sleep again - Clicking another checkbox - the record is selected but the controls stay sleeping - Clicking yet another checkbox results in the controls waking up - etc etc etc I tried adding a wait window before doing the scan thinking that a manual delay may give the system time to write to the table. This did not make a difference. At this point I'm thinking to try a non SQL scan to see if that solves the problem. I hope this all makes sense. Thanks, Joe On Wed, Jun 4, 2014 at 4:01 PM, Dan Covill <[email protected]> wrote: > Joe, > How are you 'updating' the table, via buffering or a transaction? IOW, > seems like the update is delayed somehow, so it wipes out whatever your > method did. > I don't do buffering or transactions, but one idea that occurs to me is to > set a form.property .T. when the column changes, and have the update call > the adjustment if the property is set.Are the values the proc adjusts > fields in the table? Does the update overwrite them? > Dan > > > Date: Wed, 4 Jun 2014 13:26:39 -0400 > > Subject: How to trigger an update in a grid > > From: [email protected] > > To: [email protected] > > > > Scenario: > > > > - A table with a logical column for selected rows > > - A grid with a table as the ControlSource > > - The grid has a checkbox for the selected column > > - Any change in the selected column needs to call a procedure that > scans > > the table for selected records and adjusts values and controls based > on > > what it finds > > > > I have everything working except the automatic triggering of the > procedure. > > I have tried it in the Click, InteractiveChange, and Valid events of the > > checkbox on the grid. The procedure runs but it seems to do so before > the > > table has been updated. > > > > How can I have the procedure run after the table has been updated? > Another > > approach? > > > > Ultimately I need to expand the update routine to change the criteria of > > the records that display in the grid. I was expecting to do this by > > changing the setting of a filter but I could change over to using a > cursor > > and create a new one each time there is a change in the selected items. > > Does this sound feasible in a grid or should I change to a different > > approach? > > > > Thanks in advance, > > > > Joe > > > > > > --- StripMime Report -- processed MIME parts --- > > multipart/alternative > > text/plain (text body -- kept) > > text/html > > --- > > [excessive quoting removed by server] _______________________________________________ Post Messages to: [email protected] Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/CABQeDnWaOSQB8HsN+6g-h+emQ0XPjauKRHU_9JiKbknTV=h...@mail.gmail.com ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

