Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Procedural Code
Message
 
To
30/10/1998 12:24:54
Ian Matthews
Up & Running Technologies Inc
Chestermere, Alberta, Canada
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00152898
Message ID:
00152922
Views:
22
Ian,
Try using the NAME option when DOing the form:

DO FORM Contacts NAME Contacts

This gives an object reference to the form, so now you can do:
Contacts.txtName.Enabled = .T.

Hope this helps...
Mark


>I can not find a place to put procedure code that will allow me to modify a form. Specifically if a simple test is .t. then I want several fields on a form to be disabled.
>
>All of my other PROCEDUREs are stored in my main program. However if, in my main program, I put PROCEDURE code that changes a the ENABLED property of a field, I get one of two errors:
>
>1: if I use THISFORM.FIRST_NAME.ENABLED=.f., VFP informs me that THISFORM can only be used in a form, not a program, or;
>
>2: if I use the name of the form CONTACTS.FIRST_NAME.ENABLED=.f. VFP informs me it can not find the object CONTACTS.
>
>This code is specific to one form so I thought I would try to put the code in the INIT method of the form but VFP informs me that METHODS AND EVENTS CAN NOT CONTAIN NESTED PROCEDURALS. I am fairly certain that this is where I put PROCEDURE code using FP2.6 but apparently it has changed.
>
>Where can I put reusable code that makes changes to a fields properties on a form?
"It hit an iceberg and it sank. Get over it."
Robert Ballard, dicoverer of the Titanic wreckage.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform