On 9/8/2010 12:57 PM, Tracy Pearson wrote: > MB Software Solutions, LLC wrote on 2010-09-08: >> One of my older clients (7 years ago! And that app is still kicking >> ass for them! haha) has requested that I change their app to >> auto-save based on activity/inactivity. Does this mean that in my >> entry controls like textbox, editbox, checkbox I put code in the >> KeyPress to update the form's custom "LastHit" property with the >> current date/time stamp and key off of that for logic to save and/or >> kick them out (due to inactivity)? Could add code in the button's >> GotFocus event too I guess. >> >> Ideas? >> >> tia, >> --Mike >> > > Mike, > > The form has a KeyPreview property. When you set this to .T. you can do > something in the KeyPress event. > If you are using VFP 9 you might be able to bindevent() to the ActiveControl > property to know when the control changes. I'm not sure if the old > ActiveControl_assign method will help here. It has been known to be > problematic so have it call another method to do your processing, with > either bindevent or _assign.
Hi Tracy, If I can just put code in the form's KeyPress event (with KeyPreview=.T.) that should do it. I can use that to populate the datetimestamp and then if it's been more than 5 minutes, I can log them out of the application. Thanks for the tip! --Mike -- Mike Babcock, MCP MB Software Solutions, LLC President, Chief Software Architect http://mbsoftwaresolutions.com http://fabmate.com http://twitter.com/mbabcock16 _______________________________________________ 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.

