The view is set to Key and modified fields and Update using SQL Update. The changed data is based on the value of an existing field. So first, you have to get the value, add or subtract one from it and then save it. The problem I'm seeing is if two people query the view at the same time and grab the same starting value. For example, two users requery at the same time and get a start value of 27. One user adds one to 27 and the other user subtracts one from 27. Whoever saves last wins which throws the count off.
So I'm throwing around the idea of a timestamp for my local views. I create a number field in the table and update the view to reflect that. I then set a variable to the value of the SECONDS() command. The user saves that value. I then requery again and check to see if the timestamp number is the same. If it is, then I can write my value, otherwise I delay a second and then loop again. The function I'm trying to accomplish here is basic inventory and shipping. One user is adding to inventory while another is subtracting it out by shipping the same product. I'm sure this isn't anything new but when working with local views/SQL, I'm not sure how to guarantee the right value gets written since I can't lock a local view/SQL. >>> [EMAIL PROTECTED] 10/24/08 12:14PM >>> Hi James, >>I'm using the VFP 9 framework Visual Promatrix which relies on the Last Save >>method. I have run into a situation where this doesn't work for me. In particular, the scenario I'm dealing with is Inventory On Hand. I'm using local views with the hope of moving to SQL in the future.<< Sounds like you have the WhereType for the view set to Key Field Only. If this is the case try setting the WhereType to Key and Modified Fields. This will alter the Update statement where clause sent by VFP to the data. This technique will work with both local and backend data. Rick White Light Computing, Inc. www.whitelightcomputing.com www.swfox.net www.rickschummer.com [excessive quoting removed by server] _______________________________________________ Post Messages to: [email protected] Subscription Maintenance: http://leafe.com/mailman/listinfo/profox OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/[EMAIL PROTECTED] ** 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.

