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: 532 # Views: 1 # Ratings: 0
Version: Unknown Category: General VFP Topics
Date: Monday, June 04, 2001 10:14:31 AM         
   


> 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


ENTIRE THREAD