Current work area being reset by form somehow 
Author Message
 Current work area being reset by form somehow

Hi all,

I have never visited here before but this seems the best place to ask a
question that has been bugging me for months.

In the application there is a report grid for user's to choose a report.
The report can be chosen by either double clicking the report or clicking on
a button.  The required data entry screen appears to enter report
parameters, the required data selection occurs, and finally the report is
run.

The double click method calls the button's click method so it should be as
if they had clicked the button directly.

The problem becomes apparent when the application is run with the data
session window open.  If the button is clicked then the program works
correctly, that is the current work area becomes the one used by the
selected report.  However, if the double click method is used, the current
work area is always '_reports' whenever a read event occurs, irrespective of
what the underlying code has acutally set it to, and irrespective of the
currently open form.



Sun, 06 Feb 2005 06:12:56 GMT  
 Current work area being reset by form somehow
This is a known grid problem.
Try to add next command as the first command in the button's click method

This.setfocus

Leonid


Quote:
> Hi all,

> I have never visited here before but this seems the best place to ask a
> question that has been bugging me for months.

> In the application there is a report grid for user's to choose a report.
> The report can be chosen by either double clicking the report or clicking
on
> a button.  The required data entry screen appears to enter report
> parameters, the required data selection occurs, and finally the report is
> run.

> The double click method calls the button's click method so it should be as
> if they had clicked the button directly.

> The problem becomes apparent when the application is run with the data
> session window open.  If the button is clicked then the program works
> correctly, that is the current work area becomes the one used by the
> selected report.  However, if the double click method is used, the current
> work area is always '_reports' whenever a read event occurs, irrespective
of
> what the underlying code has acutally set it to, and irrespective of the
> currently open form.



Sun, 06 Feb 2005 15:18:08 GMT  
 Current work area being reset by form somehow
Thanks.

It worked.

Tony.


Quote:
> This is a known grid problem.
> Try to add next command as the first command in the button's click method

> This.setfocus

> Leonid



> > Hi all,

> > I have never visited here before but this seems the best place to ask a
> > question that has been bugging me for months.

> > In the application there is a report grid for user's to choose a report.
> > The report can be chosen by either double clicking the report or
clicking
> on
> > a button.  The required data entry screen appears to enter report
> > parameters, the required data selection occurs, and finally the report
is
> > run.

> > The double click method calls the button's click method so it should be
as
> > if they had clicked the button directly.

> > The problem becomes apparent when the application is run with the data
> > session window open.  If the button is clicked then the program works
> > correctly, that is the current work area becomes the one used by the
> > selected report.  However, if the double click method is used, the
current
> > work area is always '_reports' whenever a read event occurs,
irrespective
> of
> > what the underlying code has acutally set it to, and irrespective of the
> > currently open form.



Mon, 07 Feb 2005 09:04:29 GMT  
 Current work area being reset by form somehow

In the application there is a report grid for user's to choose a report.
The report can be chosen by either double clicking the report or
clicking on
a button.  The required data entry screen appears to enter report
parameters, the required data selection occurs, and finally the report
is
run.

The double click method calls the button's click method so it should be
as
if they had clicked the button directly.

The problem becomes apparent when the application is run with the data
session window open.  If the button is clicked then the program works
correctly, that is the current work area becomes the one used by the
selected report.  However, if the double click method is used, the
current
work area is always '_reports' whenever a read event occurs,
irrespective of
what the underlying code has actually set it to, and irrespective of the
currently open form.

Tony, have you put a breakpoint on ALIAS() in the Watch window to stop
the trace when the work area actually changes?

--

Cindy Winegarden  MCSD, Microsoft Visual FoxPro MVP

http://msdn.microsoft.com/vfoxpro  http://foxcentral.net



Fri, 11 Feb 2005 00:01:28 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. No table is open in the current work area when setfocus

2. No table is open in the current work area

3. TableUpdate() switches the current work area

4. Help: No table is open in the current work area

5. Help needed: No tables open in current work area

6. API - set current work area?

7. Edit buttons on form call to wrong work area

8. VFP, Excel,automation, How to Select the current area

9. Disable back form and keeping focus on current form

10. Disable back form and keeping focus on current form

11. Resetting defaults on a form

12. Reset Form and Controls

 

 
Powered by phpBB® Forum Software