Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid based on remote view
Message
From
14/06/1999 17:22:36
 
 
To
14/06/1999 15:09:18
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00229014
Message ID:
00229744
Views:
18
Erik,

Thanks for the help!! "Replace" fixed the problem.

PF


>the behavior you are seeing stems from a (IMHO strange) fact about databound checkboxes: they have not yet updated the field they are bound to in the interactivechange event. You can demostrate this easily by dropping a check box on a form and binding it to a logical field. In the interactiveChange event, put the following code:
>
>WAIT WINDOW "Field: " + IIF(MyTable.MyField, "True", "False")
>
>WAIT WINDOW "Value: " + IIF(THIS.Value, "True", "False")
>
>So, since you are summing the totals in a method called from this event, your total will always be one behind. You can fix this by manually REPLACEing the field value in the interactive change before calling THISFORM.GetTotal().
>
>>Eric,
>>
>>In the interactive change method of the checkbox, in the grid, I have:
>>
>>=tableupdate(.t.) && just to make sure
>>=thisform.GetTotal() && sum method
>>
>>The odd thing, is that there is a command button on the form to create a file based on the rows in the grid that are checked. If I uncheck 1 row, then click the button, the created file has the right items in it. But the total shown still includes the item I unchecked.
>>
>>PF
>>
>>>>I have a grid based on a remote view created with sql pass through. I add a logical field in the sql statement as the purpose of the grid is to check off the rows that are to be included in a report.
>>>>
>>>>The view is marked .f. for update since all I'm doing is outputing certain records. The problem I'm having is that I want a running total of all the records checked.
>>>>
>>>>I have a form method that does a sql select sum.... based on the logical field. The problem I'm having is that no matter where I put a call to the sum method, the sum doesn't take into account the check / uncheck that just occured. It is based on the check / uncheck before. I.E. the 1st click on the checkbox does nothing, the 2nd click shows the total as the amount from the 1st invoice, the 3rd click shows the total as the amount from 1 + 2, etc.
>>>>
>>>>Anyone have any suggestions? Thanks,
>>>>
>>>>PF
>>>
>>>Where are you calling the SUM mehod from? What happens if you put in a commandbutton on the form?

(On an infant's shirt): Already smarter than Bush
Previous
Reply
Map
View

Click here to load this message in the networking platform