Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Manisha Sathe
  Where is Manisha Sathe?
 Manisha Sathe
Subject: Validating form - auto disable of i/p boxes
Thread ID: 33590 Message ID: 33590 # Views: 2 # Ratings: 0
Version: Visual FoxPro 8 Category: Forms
Date: Saturday, November 29, 2003 10:14:46 AM         

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')
IF (thisformset.form1.Check1.Value = 1) AND (EMPTY(thisformset.form1.MONRATE1.value))
MESSAGEBOX("Please fill in monthly rate")
IF (thisformset.form1.Check1.Value = 0) AND (EMPTY(thisformset.form1.DAILYRATE1.value))
MESSAGEBOX("Please fill in daily rate")
select customerrate

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



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