I'm not sure exactly how to describe this problem, but i'll try my best...
We have browwind.scx, a form that contains a grid only, which allows the user to browse and select records from a main table. When a user presses enter, or double clicks, it opens up another window (fiche.scx).
Both screens have private data sessions.
In fiche, i wanted to produce an error, so i created a button (command1) with the following code :
SELECT system
USE
SELECT system
MESSAGEBOX(system.name)
I wanted to produce error 13, "Alias 'system' not found". In a procedure we have, called errorsys, i could catch which error occurred, find the table name, open it if i need to, without having to worry about why the table wasn't open in the first place. (yeah yeah, i know its lazy...)
Neither form has code in their error event. But they share the same base class (_form), which has code that formats errors and sends the data to errorsys.
At first, i thought i wouldn't even have to worry about how errorsys was called (either thru the ON ERROR DO errorsys WITH ... or the Error event, which called errorsys).
What is irking me is that when Command1 is clicked, it selects the table system, then closes it, then tries to select it. right away, i'm in the Error event of browwind, (the first form, with the grid). In the data session of browwind, system is already open!! (forget that its the system table...i never have a problem with that not being open, but i just happened to pick that one to test with..might as well be table 'blah').
One problem i see arising is that let's say it were table blah, which browwind has no need of but fiche does. The code i put to open blah in errorsys (or whatever table wasn't found) will open it in the wrong database. and then i've solved nothing.
My question is, why is the error event of the first form being called and not of the second, which has been fully loaded and which contains the object causing the error?
thanks
We have browwind.scx, a form that contains a grid only, which allows the user to browse and select records from a main table. When a user presses enter, or double clicks, it opens up another window (fiche.scx).
Both screens have private data sessions.
In fiche, i wanted to produce an error, so i created a button (command1) with the following code :
SELECT system
USE
SELECT system
MESSAGEBOX(system.name)
I wanted to produce error 13, "Alias 'system' not found". In a procedure we have, called errorsys, i could catch which error occurred, find the table name, open it if i need to, without having to worry about why the table wasn't open in the first place. (yeah yeah, i know its lazy...)
Neither form has code in their error event. But they share the same base class (_form), which has code that formats errors and sends the data to errorsys.
At first, i thought i wouldn't even have to worry about how errorsys was called (either thru the ON ERROR DO errorsys WITH ... or the Error event, which called errorsys).
What is irking me is that when Command1 is clicked, it selects the table system, then closes it, then tries to select it. right away, i'm in the Error event of browwind, (the first form, with the grid). In the data session of browwind, system is already open!! (forget that its the system table...i never have a problem with that not being open, but i just happened to pick that one to test with..might as well be table 'blah').
One problem i see arising is that let's say it were table blah, which browwind has no need of but fiche does. The code i put to open blah in errorsys (or whatever table wasn't found) will open it in the wrong database. and then i've solved nothing.
My question is, why is the error event of the first form being called and not of the second, which has been fully loaded and which contains the object causing the error?
thanks