Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sometimes thing?
Message
From
28/03/2001 12:30:59
Chuck Tripi
University of Wisconsin - Milwaukee
Milwaukee, Wisconsin, United States
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Sometimes thing?
Miscellaneous
Thread ID:
00489509
Message ID:
00489509
Views:
33
Below are the code that I have in the end of the 'Save' button (after I do the saving part with all kinds of IF...ENDIFs). The mystery thing is sometimes the buttons are not doing the enabling/disabling prompterly. It happens when we fill the whole field in any of the fields, but sometimes not on that too. I am wondering if it's too fast or any ideas? I mean it works, but sometimes not (even when doing the same thing testing)? What happens when it does not work right is that it leaves the Add, Edit, and Esc buttons enabled and the rest (Save,Delete, and Exit) disabled. So, you can see that the Esc is after the CheckAuthForPerson Method, but the Esc button does "disable" while not greying it out (yet, the Add and Edit are ok while the supposed enabled Delete and Exit are not enabled). I am confused, can you see something that I may be overlooking? It does not crash the program or anything like that, just that we need to close the form and come back...

Thanks.

Chuck

*****************************************************
'Save' button (Command3)

This.Parent.Command1.ENABLED = .T. <- Add button
This.Parent.Command2.ENABLED = .T. <- Edit button
This.Parent.Command3.ENABLED = .F. <- Save button
*This.Parent.Command4.ENABLED = .T. <- Delete button, but the next line takes care of it, which has the code below as well
ThisForm.CheckAuthForPerson(m.id)
This.Parent.Command5.ENABLED = .T. <- Exit button
This.Parent.Command6.ENABLED = .F. <- Esc button
ThisForm.Command1.ENABLED = .T. <- another button to pop another form
ThisForm.Command2.ENABLED = .T. <- same as preivous line
ThisForm.List1.ENABLED = .T.
ThisForm.text1.ENABLED = .F.
ThisForm.text2.ENABLED = .F.
ThisForm.text3.ENABLED = .F.
ThisForm.text4.ENABLED = .F.
ThisForm.List1.Requery()
SEEK(m.id)
ThisForm.List1.Value = person.id+"  "+person.logon+"  "+person.name
ThisForm.List1.SetFocus()
ThisForm.Refresh()

*****************************************************
Form.CheckAuthForPerson (Form's Method)

LPARAMETERS lcPersonID
SELECT auth
SEEK lcPersonID
IF FOUND()
	ThisForm.CommandGroup1.Command4.Enabled = .F.
	authct = .T.
ELSE
	ThisForm.CommandGroup1.Command4.Enabled = .T.
	authct = .F.
ENDIF
SELECT person
Today is tomorrow's yesterday.
Next
Reply
Map
View

Click here to load this message in the networking platform