Hi All..,
Hope someone can shed some light onto a little problem i'm having.
I read an article about using BINDEVENT instead of setting a form to modal so that when the "edit" form is release you can refresh the parent form's grid with any edited / new values.
Configuration:-
Windows 7 Pro
Visual foxpro 9 SP2
I am using private data sessions for all of the forms.
I have a parent form with a grid, when you double click on a grid row the "edit form" is launched.
Here is the code on the parent form.
***************************************
DO FORM forms\table_custom_add_edit NAME loForm WITH lnID && lnID is the ID of the record to be edited
BINDEVENT(loForm, "Destroy", ThisForm, "grid_setup")
loForm.SHOW
***************************************
I then edit the values, save and close the form.
In the "edit" form the "destroy" event has a simple "a = 1" otherwise I found that the Destroy event was not being triggered, which caused the BINDEVENT() not to trigger.
My problem seems to be that when the Destroy even is triggered, the edit form is not release but the "grid_setup" event is being triggered in the parent form... but the datasession seems to be that of the "edit" form and not the parent form, so I get a "table not found" error when the "grid_setup" is being triggered.
I have tried adding code to the "grid_setup" to check the data session and change it to the forms data session, but that seems to be causing other problems.
Any Ideas why this may be happening and any ideas on how to fix it.
Thanks for your time.
Regards
Steve
If you alway do what you've always done, you always get what you've always got.
Hope someone can shed some light onto a little problem i'm having.
I read an article about using BINDEVENT instead of setting a form to modal so that when the "edit" form is release you can refresh the parent form's grid with any edited / new values.
Configuration:-
Windows 7 Pro
Visual foxpro 9 SP2
I am using private data sessions for all of the forms.
I have a parent form with a grid, when you double click on a grid row the "edit form" is launched.
Here is the code on the parent form.
***************************************
DO FORM forms\table_custom_add_edit NAME loForm WITH lnID && lnID is the ID of the record to be edited
BINDEVENT(loForm, "Destroy", ThisForm, "grid_setup")
loForm.SHOW
***************************************
I then edit the values, save and close the form.
In the "edit" form the "destroy" event has a simple "a = 1" otherwise I found that the Destroy event was not being triggered, which caused the BINDEVENT() not to trigger.
My problem seems to be that when the Destroy even is triggered, the edit form is not release but the "grid_setup" event is being triggered in the parent form... but the datasession seems to be that of the "edit" form and not the parent form, so I get a "table not found" error when the "grid_setup" is being triggered.
I have tried adding code to the "grid_setup" to check the data session and change it to the forms data session, but that seems to be causing other problems.
Any Ideas why this may be happening and any ideas on how to fix it.
Thanks for your time.
Regards
Steve
If you alway do what you've always done, you always get what you've always got.