Hi all, I'm having a tetbox on my form I want the users should type (or scan
from barcode) a value then in VALID event process some code then clear the
value and keep focus on same textbox to type in new values but I can't call
Setfocus event from Valid or LostFocus events.

Any help will be greatly appriciated.

Thanks

Simon

Re: Keep focus on same control by Rick

Rick
Wed Sep 10 10:26:49 CDT 2003

Simon,
If the VALID() method returns 0, focus will stay in the same control.

Rick

"Simon" <desk10@unitd.edu> wrote in message =
news:uO1ow26dDHA.2332@TK2MSFTNGP11.phx.gbl...
> Hi all, I'm having a tetbox on my form I want the users should type =
(or scan
> from barcode) a value then in VALID event process some code then =
clear the
> value and keep focus on same textbox to type in new values but I can't =
call
> Setfocus event from Valid or LostFocus events.
>=20
> Any help will be greatly appriciated.
>=20
> Thanks
>=20
> Simon
>=20
>

Re: Keep focus on same control by Eric

Eric
Wed Sep 10 10:28:39 CDT 2003

Hello, Simon!

If you issue RETURN .F. or RETURN 0 in the valid event, then the textbox
will keep focus.
--
Eric den Doop
www.foxite.com - The Home Of The Visual FoxPro Experts - Powered By VFP8



Re: Keep focus on same control by John

John
Thu Sep 11 12:30:24 CDT 2003

Actually, you can use SetFocus in a LostFocus method. Move your code to the
LostFocus method and include

nodefault

at the end of the code. This should keep the cursor in the stock lookup
textbox.

John.



"Simon" <desk10@unitd.edu> wrote in message
news:uO1ow26dDHA.2332@TK2MSFTNGP11.phx.gbl...
> Hi all, I'm having a tetbox on my form I want the users should type (or
scan
> from barcode) a value then in VALID event process some code then clear
the
> value and keep focus on same textbox to type in new values but I can't
call
> Setfocus event from Valid or LostFocus events.
>
> Any help will be greatly appriciated.
>
> Thanks
>
> Simon
>
>