Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Paul Culbertson
  Where is Paul Culbertson?
 Katy
 Texas - United States
 Paul Culbertson
 To: ERNESTO PAEZ
  Where is ERNESTO PAEZ?
 FT LAUDERDALE
 Florida - United States
 ERNESTO PAEZ
 Tags
Subject: RE: what is the property texbox that i need to put code to validate if data inputed exist ?
Thread ID: 531 Message ID: 536 # Views: 1 # Ratings: 0
Version: Unknown Category: General VFP Topics
Date: Monday, June 04, 2001 3:02:03 PM         
   


Ernesto,

use the following to return control to the textbox without leaving it.

return 0

you can place that in the if..else...endif statement

NOTE: the number 0 actually can be a positive or negative value to represent where you want the cursor to end up at via tabs... like return 2 would advance you forward by 2 tabs.


> Paul
> THE code you gave me for the textbox works ok but if i want after i typed the
> wrong data or if data is not found, the messsagebox show up i want when i
> press ok from the messagbox make the mouse cursor to get back to that texbox and make the
> textbox got focus and reseted for trying again without going to next textbox until i typed the right data
> thank you
>
>
> > > Hi
> > > I have a form with a few textboxes the data that i am going to type is string data, when i am inputing the data in this texbox i would like to know after the data is typed in this texbox is that data already exist in my table because in fact the data that i have to type here have to exist, the reason that i want to do this is beacuse if i make a mistake typing the data in this texbox i want to be warned that this data does not exist and then be able to reenter it.
> > >
> > > i have the idea that i need to put some kind of code in the gotfocus event or in the interactivechange event of the textbox something like:
> > >
> > > SEEK THISFORM.TXTCUSTID.VALUE
> > > IF !FOUND()
> > > MESSAGE "WRONG DATA OR NOT FOUND "
> > > RETU .T.
> > > ENDIF
> > > (let's assume the texbox is named txtcustid) is this right ?
> > > could you give me some help here please
> > > thank you so much in advance
> >
> > Ernesto,
> >
> > Generally speaking it is bad coding to validate the entry of text until the user want to continue by pushing a continue or ok button. That is just another topic all together.
> >
> > With that said, if this is what you are trying to achieve...I'd put it in the valid()
> >
> > if !seek(this.value,"mytable","myindex")
> > =messagebox("Item not found.",32,"NOT FOUND")
> > endif
> >
> > Paul Culbertson
> >
> > Home of the Visual FoxPro Experts
> >
> > Houston, TX
> >


Paul Culbertson

Home of the Visual FoxPro Experts

Houston, TX


ENTIRE THREAD