General information
Category:
Coding, syntax & commands
>>I have a form that can be opened multiple times in an application. Very basic where the form is a private data session. One table (vfp) added in the dataenvironment with buffer (5) Opt. Table buffering.
>>
>>Each control on the form has a controlsource to a field in the table.
>>
>>If there are 2 of these forms open at once and happen to be pointed to the same record in the table and From1 has some changes that have been committed to the table with a tableupdate, how can i get Form2 to recognize these changes without going out of form and back into it.
>>
>>Likewise, if not on the same record and Form2 has a way to move the record pointer to the same record as Form1 (above), it still shows the original value for the controls.
>
>Are you using local/remote views or are you using the table directly?
>
>What I've done in the past (and yes it is a huge pain in the neck) is use views, put timers on the screen to auto-requery the data IF you're form is NOT in "edit-mode" - and then put some code in the activate() method to make sure it requerys the data when the form comes active (again - if not in "edit-mode"). Then, when saving - check to see if the back-end data has changed from what it was orignially - if it has then send message to user so they know they're about to overwrite what someone else just did and display what has changed. At one point I spent a few months writing some really slick class-libs that dealt with all this - I think many of the VFP frameworks deal with this issue too.
What I have found to work is to simply do a tablerevert but that really bothers me and I was hoping for some other solution.
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