Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Chan Kok Kiet
  Where is Chan Kok Kiet?
 Kuala Lumpur
 Malaysia
 Chan Kok Kiet
 To: Manisha Sathe
  Where is Manisha Sathe?
 
 Singapore
 Manisha Sathe
 Tags
Subject: RE: Validating form - auto disable of i/p boxes
Thread ID: 33590 Message ID: 33592 # Views: 1 # Ratings: 0
Version: Visual FoxPro 8 Category: Forms
Date: Saturday, November 29, 2003 12:33:37 PM         
   


HI,
Are you using data binding, controlsource = ???

If so, the value in your control may be changed since SEEK command will move cursor pointer.
To check for duplication, you can either use SQL-SELECT or INDEXSEEK() whick will not move pointer.

HTH

> i have a form with add/save/cancel
>
> Initially all are readonly = .T. (having different color)
>
> when add is clicked -
>
> i issue append blank I make readonly = .F. and refresh the form
>
> when save is clicked i want to validate the data and if valid then tablerevert(.T.) (it is in buffer mode)
> Following is my code - some starnge is happening
>
> save - Click code
>
> *SELECT customerrate
> *SET ORDER TO custno
> *SEEK ALLTRIM(TRIM(thisformset.combo_value))
> *IF FOUND() then
> * MESSAGEBOX('This customer already is having record, can not add again, please edit existing')
> *ELSE
> IF (thisformset.form1.Check1.Value = 1) AND (EMPTY(thisformset.form1.MONRATE1.value))
> MESSAGEBOX("Please fill in monthly rate")
> ELSE
> IF (thisformset.form1.Check1.Value = 0) AND (EMPTY(thisformset.form1.DAILYRATE1.value))
> MESSAGEBOX("Please fill in daily rate")
> ELSE
> select customerrate
> TABLEUPDATE(.T.)
> UNLOCK ALL
> _screen.activeform.refresh
> ENDIF
> ENDIF
> *ENDIF
>
> Code is working properly - all messages are ok, (Both - with commented code when uncommented and the code as above)
> 1)BUT If I uncomment above commented code AND if i get error "Please fill in daily/ monthly rate " - after this msg if i try to enter the rate then field on form automatically become - readonly = .T. if i click another field - same - so all become readonly = .T. eventually
> 2)if i keep above code as it is (i.e Select .. all commented) then all is ok
> 3)if i change the if else if else ...end if end if structure then also it is same - all fields bcome readonly = .T.
>
> i just hope u ppl understand what i mean to say
>
> regards
> manisha


I am not the most powerful man in this world.
I am not the worst man in this world either.
I just as same as all of you.
I still need to learn from my mistakes...

ENTIRE THREAD

Validating form - auto disable of i/p boxes Posted by Manisha Sathe @ 11/29/2003 10:14:46 AM
RE: Validating form - auto disable of i/p boxes Posted by Chan Kok Kiet @ 11/29/2003 12:33:37 PM
Thanks Posted by Manisha Sathe @ 12/2/2003 3:01:47 AM