Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Working with commandbuttons class
Message
From
16/04/2009 07:37:21
 
 
To
15/04/2009 22:03:24
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01395069
Message ID:
01395090
Views:
181
>I have a series of data entry forms with add edit delete buttons. I created a class so I can just drop these buttons to the forms.
>
>In my previous applications, I would drop these buttons in my forms and edit each buttons in the forms to include the code below
>SET MULTILOCKS ON
>=Cursorsetprop("Buffering",5,"Employee")
>=Tableupdate(.T.)
>
>I do this for every data entry forms and just modifies the table name.
>
>I wonder if I could just put the code above in my buttons class, then possibly pass the name of the open table to the class?
>
>How can I achieve this?

I would argue that SET MULTILOCKS ON and the CURSORGETPROP belong at the form-level, not in your button class. Put SET MULTILOCKS ON in the Load method of your "base" form class. If you use the data environment, set up buffering for the tables there. If not, put that code wherever you open the tables, or in your "base" form class, add code that loops through all open tables and sets up buffering.

The TableUpdate() does belong in your Save button (but I wouldn't think in any other) and yes, you can set that up in the button class. Just add it to the Click method of that button.

Tamar
Previous
Reply
Map
View

Click here to load this message in the networking platform