>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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only