Sometimes, vfp9 selects different working area, without any "select" command; I tried to find some answers on the internet, but I didn't found anything, so I'll try to explain here and maybe someone can help ...
So:
Case 1:
I have a form (form1) with a grid (grid1) and a command button (command1) in it; inside the "Init" method of the form I do this: "create cursor c1(... fields ...)" and thisform.grid1.recordSource="c1".
Then, on the "click" event of command1 I create another cursor (c2) and then run another form (form2) with another grid in it, with the record source set to c2.
The problem is that, even if i issue a "select c2" before "do form form2", when form2 shows up, the selected working area is c1, and I would really want to know why (the workaround for this problem was to put "select c2" on the form2's "Activate" method). What is interesting is that this not occurs all the time; in some cases works normally.
Case 2:
Something similar with the first case (form grid, command button) but this time, on click event, after I create the cursor (and fill it with data) I want run a report; what is very strange here is that the report shows up ok (preview), but when I try to zoom in, the selected area changes from c2 to c1, and I got an error, and then the report closes.
If the first case was (kind of) easy to fix, the second one left me without any solution, so if anyone have an ideea, I'm all ears (I mean .. eyes
)
So:
Case 1:
I have a form (form1) with a grid (grid1) and a command button (command1) in it; inside the "Init" method of the form I do this: "create cursor c1(... fields ...)" and thisform.grid1.recordSource="c1".
Then, on the "click" event of command1 I create another cursor (c2) and then run another form (form2) with another grid in it, with the record source set to c2.
The problem is that, even if i issue a "select c2" before "do form form2", when form2 shows up, the selected working area is c1, and I would really want to know why (the workaround for this problem was to put "select c2" on the form2's "Activate" method). What is interesting is that this not occurs all the time; in some cases works normally.
Case 2:
Something similar with the first case (form grid, command button) but this time, on click event, after I create the cursor (and fill it with data) I want run a report; what is very strange here is that the report shows up ok (preview), but when I try to zoom in, the selected area changes from c2 to c1, and I got an error, and then the report closes.
If the first case was (kind of) easy to fix, the second one left me without any solution, so if anyone have an ideea, I'm all ears (I mean .. eyes