main logo
Subject: RE: Restrict Textbox Values?
Author: "Stephen Russell"
Posted: 2003/10/31 11:00:00
 
View Entire Thread
New Search


You either put in a
if lastkey or DoDefault()

Now in your base textbox place the code if lastkey = ?? Return .t. in
it's valid.

</Framework 101>

Stephen Russell
S.R. & Associates
Memphis TN 38115
901.246-0159

The 4 billion dollars that Microsoft spent seems to have run out just
about the time they got to the datagrid. . . .


-----Original Message-----
From: profox-bounces .AT. leafe .DOT com [mailto:profox-bounces@leafe.com] On
Behalf Of Greg Gum
Sent: Friday, October 31, 2003 9:49 AM
To: profox .AT. leafe .DOT com
Subject: RE: Restrict Textbox Values?


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 = 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@leafe.com [mailto:profoxtech-bounces .AT. leafe .DOT com]
On Behalf Of Cotton Mr Jerry P
Sent: Friday, October 31, 2003 9:29 AM
To: profoxtech@leafe.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
mailto:cottonjp.ctr .AT. 2mawcp .DOT usmc.mil


> -----Original Message-----
> From: Ed Leafe [mailto:ed@leafe.com]
> Sent: Friday, October 31, 2003 9:57 AM
> To: ProFox Email List
> Subject: Re: Restrict Textbox Values?
>
>
> On Friday, October 31, 2003, at 09:48 AM, Cotton Mr Jerry P wrote:
>
> > Let me get this straight. You're saying that the data gets
> written to
> > disk
> > in the Valid and that you can't revert it in the lostfocus.
> Are you
> > saying
> > that you would allow code to prevent a control from losing
> focus but
> > the
> > data was already written to disk. Doesn't sound to kosher to me.
>
> If valid returns .T. or a non-zero numeric value, the
> ControlSource is
> updated with the contents of the control at that point. If the
> ControlSource is a field in a cursor, that field is updated
> then. With
> buffering, LostFocus could possibly revert it to its original
> unchanged
> value, but it is severely limited - it can only revert or accept. If
> there was an intermediate value, it's gone by the time LostFocus()
> fires.
>
> ___/
> /
> __/
> /
> ____/
> Ed Leafe
> http://leafe.com/
> http://opentech.leafe.com
>
>
[excessive quoting removed by server]


 
©2003 Stephen Russell
<-- Prior Message New Search Next Message -->