Yes, but your framework should take care of NOT updating the record if = the user cancels.
I go one step being using either the Valid or LostFocus, and have a = method called ISDATAVALID that the framework calls when it really is ready to validate. If a user is canceling out of a form, then it never gets = called so you don't get into the situation where the user wants to cancel, but = the Valid() keeps putting the user back in a textbox. One way around this = is checking for LastKey =3D 27 in your valid event, but I don't like having = to remember to put that in every time.
Greg
-----Original Message----- From: profoxtech-bounces (AT) leafe DO.T com [mailto:profoxtech-bounces@leafe.com] = On Behalf Of Cotton Mr Jerry P Sent: Friday, October 31, 2003 9:29 AM To: profoxtech (AT) leafe DO.T com
I guess my problem with this is having a field as a control source. I = can envision modifications being made to a table, the user getting some kind = of error in the lostfocus and just canceling out of the form. Now a record = has been updated in the table but the user thinks he cancelled what he = started.
No wonder I don't use fields as controlsources.
Jerry Cotton, MCP 2nd Marine Aircraft Wing Management Training and Assistance Team Cherry Point, NC 28533 (252)466-4854=20 mailto:cottonjp.ctr@2mawcp.usmc.mil
> -----Original Message----- > From: Ed Leafe [mailto:ed (AT) leafe DO.T com] > Sent: Friday, October 31, 2003 9:57 AM > To: ProFox Email List > Subject: Re: Restrict Textbox Values? >=20 >=20 > On Friday, October 31, 2003, at 09:48 AM, Cotton Mr Jerry P wrote: >=20 > > Let me get this straight. You're saying that the data gets=20 > written to=20 > > disk > > in the Valid and that you can't revert it in the lostfocus.=20 > Are you=20 > > saying > > that you would allow code to prevent a control from losing=20 > focus but=20 > > the > > data was already written to disk. Doesn't sound to kosher to me. >=20 > If valid returns .T. or a non-zero numeric value, the=20 > ControlSource is=20 > updated with the contents of the control at that point. If the=20 > ControlSource is a field in a cursor, that field is updated=20 > then. With=20 > buffering, LostFocus could possibly revert it to its original=20 > unchanged=20 > value, but it is severely limited - it can only revert or accept. If=20 > there was an intermediate value, it's gone by the time LostFocus()=20 > fires. >=20 > ___/ > / > __/ > / > ____/ > Ed Leafe > http://leafe.com/ > http://opentech.leafe.com >=20 >=20 [excessive quoting removed by server]
©2003 Greg Gum |