Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Record searching on textbox lostfocus event
Message
 
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00834029
Message ID:
00834061
Views:
29
Soykan,

I imagine it's as simple as changing one line:
If Found( this.lcTable )
If you do not send an alias to found() it returns the found() status of the current workarea.

>i've a textbox class and i've added 3 property to it. called lctable,lcindex,llunique.
>i wantto do when the user lost the focus of the textbox , lost focus event of textbox will search entered value on the table and will alert that 'this record allready saved on this table' etc.. i've code below but vfp gives "this record allready exist on this table" as my messagebox syntax.
>
>here is my code,
>
>* textbox lostfocus event code
>If This.llunique = .T.
>lcvalue=this.value
>	SEEK (this.value) ORDER (this.lcindex) IN (this.lctable)
>If Found()
>		Messagebox("&lcvalue allready exist on the table",16,"Opps...")
>		This.SetFocus
>	Endif
>Endif
>
>
>So, it doesnt noticed that if user enter some values or not
>eg (there is 2 record on the table which is idno 123 and 1234 ) vfp behaviour allways found()=.t. but when i enter eg 'rtf123' i am getting same alert why ?
>
>how is your suggestions about this matter? i wantto use this control in my standart base txtbox class and it should be parametric for tablename,indexname and will search entered value if found() .f. no problem can append or etc, if .t. must alert the user 'this value allready exist'
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform