Application Error -- on MouseDown in a Grid 
Author Message
 Application Error -- on MouseDown in a Grid

I have several users that are having the same problem.  While in a
grid they receive an error type 5, in a MouseDown Event in a grid.

The have code in the AfterRowColChange event of the grid that does the
following :

*--- enable the "SAVE PO" button
poSaved = .F.
THISFORM.PageFrame1.Page2.Command6.Enabled = .T.
THISFORM.Refresh

and code in Column1.Header1.Text1 dblClickEvent that does the
following:

SELECT (cNew)
BROWSE FIELDS LINE_NR, ALLOWANCE, ORDER_QUAN, PRICE, PACKSIZE,
SHIP_WT, PRD_CODE, DESCRIP, MISC, ;
                   PRD_BRAND, COMMENTS, SHIP_QUAN,  UPC ;
        FONT 'Comic Sans MS',8 ;
        TITLE "Edit Line Items" ;
        NOAPPEND ;
        NODELETE ;
        NOMENU ;

GO TOP

DO WHILE .NOT. EOF()
        REPLACE &cNew..ext_price  WITH (&cNew..order_quan * price) -
(&cNew..order_quan *allowance)
        REPLACE &cNew..ext_ship_w WITH &cNew..ship_wt *
ABS(order_quan)
        SKIP
ENDDO

*--- recompute the totals      
SUM order_quan,ext_price,ext_ship_w;
   TO tnQuantity, tnPrice, tnshipWt

tnQuantity = "Quantity=("+TRANSFORM(tnQuantity,'999,999')+")"  
tnPrice = "Price=("+TRANSFORM(tnPrice,'99,999,999.99')+")"
tnShipWt = "ShipWt=("+TRANSFORM(tnShipWt,'99,999,999.9')+")"

THISFORM.PageFrame1.Page2.Text2.Value=tnQuantity
THISFORM.PageFrame1.Page2.Text3.Value=tnPrice
THISFORM.PageFrame1.Page2.Text4.Value=tnShipWt

All this stuff seems to work fine, so any thoughts on why I am getting
this error??

Thanks for your help.

Am I doing something wrong??  Basically the user can modify any item
in this grid, but it seems they



Mon, 13 Dec 2004 09:01:08 GMT  
 Application Error -- on MouseDown in a Grid
Hi, Jim!
You wrote  on Thu, 27 Jun 2002 01:01:08 GMT:

 J> I have several users that are having the same problem.  While in a
 J> grid they receive an error type 5, in a MouseDown Event in a grid.

 J> The have code in the AfterRowColChange event of the grid that does
 J> the following :

 J> *--- enable the "SAVE PO" button poSaved = .F.
 J> THISFORM.PageFrame1.Page2.Command6.Enabled = .T.
 J> THISFORM.Refresh

 J> and code in Column1.Header1.Text1 dblClickEvent that does the
 J> following:

 J> SELECT (cNew)
 J> BROWSE FIELDS LINE_NR, ALLOWANCE, ORDER_QUAN, PRICE, PACKSIZE,
 J> SHIP_WT, PRD_CODE, DESCRIP, MISC, ;
 J>    PRD_BRAND, COMMENTS, SHIP_QUAN,  UPC ;
 J> FONT 'Comic Sans MS',8 ;
 J> TITLE "Edit Line Items" ;
 J> NOAPPEND ;
 J> NODELETE ;
 J> NOMENU ;

 J> GO TOP

 J> DO WHILE .NOT. EOF()
 J> REPLACE &cNew..ext_price  WITH (&cNew..order_quan * price) -
 J> (&cNew..order_quan *allowance)
 J> REPLACE &cNew..ext_ship_w WITH &cNew..ship_wt *
 J> ABS(order_quan)
 J> SKIP
 J> ENDDO

 J> *--- recompute the totals
 J> SUM order_quan,ext_price,ext_ship_w;
 J>    TO tnQuantity, tnPrice, tnshipWt

 J> tnQuantity = "Quantity=("+TRANSFORM(tnQuantity,'999,999')+")"
 J> tnPrice = "Price=("+TRANSFORM(tnPrice,'99,999,999.99')+")"
 J> tnShipWt = "ShipWt=("+TRANSFORM(tnShipWt,'99,999,999.9')+")"

 J> THISFORM.PageFrame1.Page2.Text2.Value=tnQuantity
 J> THISFORM.PageFrame1.Page2.Text3.Value=tnPrice
 J> THISFORM.PageFrame1.Page2.Text4.Value=tnShipWt

 J> All this stuff seems to work fine, so any thoughts on why I am
 J> getting this error??

What VFP version do you use?
Try to save and restore record pointer in this methods (i.e. first line will
be m.lnSavedRecno = RECNO() and last lines will be IF BETWEEN
(m.lnSavedRecno, 0, RECCOUNT()) GO m.lnSavedRecno ENDIF). And maybe even
save and restore current workarea.

WBR, Igor



Wed, 15 Dec 2004 01:47:14 GMT  
 Application Error -- on MouseDown in a Grid
I am using VFP 7.0 SP1 and I don't understand your solution.
This is one of those grids that allows the user to edit and delete
items as they see fit.  Some users seem to think the error comes up
when they switch between the numeric keypad or using the mouse.   Or
maybe I should not be using the AfterRowColChange event??
Quote:

>Hi, Jim!
>You wrote  on Thu, 27 Jun 2002 01:01:08 GMT:

> J> I have several users that are having the same problem.  While in a
> J> grid they receive an error type 5, in a MouseDown Event in a grid.

> J> The have code in the AfterRowColChange event of the grid that does
> J> the following :

> J> *--- enable the "SAVE PO" button poSaved = .F.
> J> THISFORM.PageFrame1.Page2.Command6.Enabled = .T.
> J> THISFORM.Refresh

> J> and code in Column1.Header1.Text1 dblClickEvent that does the
> J> following:

> J> SELECT (cNew)
> J> BROWSE FIELDS LINE_NR, ALLOWANCE, ORDER_QUAN, PRICE, PACKSIZE,
> J> SHIP_WT, PRD_CODE, DESCRIP, MISC, ;
> J>    PRD_BRAND, COMMENTS, SHIP_QUAN,  UPC ;
> J> FONT 'Comic Sans MS',8 ;
> J> TITLE "Edit Line Items" ;
> J> NOAPPEND ;
> J> NODELETE ;
> J> NOMENU ;

> J> GO TOP

> J> DO WHILE .NOT. EOF()
> J> REPLACE &cNew..ext_price  WITH (&cNew..order_quan * price) -
> J> (&cNew..order_quan *allowance)
> J> REPLACE &cNew..ext_ship_w WITH &cNew..ship_wt *
> J> ABS(order_quan)
> J> SKIP
> J> ENDDO

> J> *--- recompute the totals
> J> SUM order_quan,ext_price,ext_ship_w;
> J>    TO tnQuantity, tnPrice, tnshipWt

> J> tnQuantity = "Quantity=("+TRANSFORM(tnQuantity,'999,999')+")"
> J> tnPrice = "Price=("+TRANSFORM(tnPrice,'99,999,999.99')+")"
> J> tnShipWt = "ShipWt=("+TRANSFORM(tnShipWt,'99,999,999.9')+")"

> J> THISFORM.PageFrame1.Page2.Text2.Value=tnQuantity
> J> THISFORM.PageFrame1.Page2.Text3.Value=tnPrice
> J> THISFORM.PageFrame1.Page2.Text4.Value=tnShipWt

> J> All this stuff seems to work fine, so any thoughts on why I am
> J> getting this error??

>What VFP version do you use?
>Try to save and restore record pointer in this methods (i.e. first line will
>be m.lnSavedRecno = RECNO() and last lines will be IF BETWEEN
>(m.lnSavedRecno, 0, RECCOUNT()) GO m.lnSavedRecno ENDIF). And maybe even
>save and restore current workarea.

>WBR, Igor



Wed, 15 Dec 2004 08:11:57 GMT  
 Application Error -- on MouseDown in a Grid
Hi, Jim!
You wrote  on Sat, 29 Jun 2002 00:11:57 GMT:

 J> I am using VFP 7.0 SP1 and I don't understand your solution.
 J> This is one of those grids that allows the user to edit and delete
 J> items as they see fit.  Some users seem to think the error comes up
 J> when they switch between the numeric keypad or using the mouse.   Or
 J> maybe I should not be using the AfterRowColChange event??

As you have code in AfterRowColChange event, add this lines befor your code:
LOCAL lnRecNo, lnOldSele
m.lnOldRecno = RECNO (This.RecordSource)
m.lnOldSele = SELECT()

And after your code:
IF BETWEEN (m.lnOldRecno, 0, RECCOUNT (This.RecordSource))
    GO (m.lnOldRecno) IN (This.RecordSource)
ENDIF
SELECT (m.lnOldSele)

Maybe you will need to add such code to other methods conserning your grid
(as header click, right click) where you have custom code, as some of you
commands may move record pointer, and some may switch workareas.

WBR, Igor



Sat, 18 Dec 2004 00:24:31 GMT  
 Application Error -- on MouseDown in a Grid
Thanks for your help Igor.  I will add the code you suggest and let
you know how it works.
Quote:

>Hi, Jim!
>You wrote  on Sat, 29 Jun 2002 00:11:57 GMT:

> J> I am using VFP 7.0 SP1 and I don't understand your solution.
> J> This is one of those grids that allows the user to edit and delete
> J> items as they see fit.  Some users seem to think the error comes up
> J> when they switch between the numeric keypad or using the mouse.   Or
> J> maybe I should not be using the AfterRowColChange event??

>As you have code in AfterRowColChange event, add this lines befor your code:
>LOCAL lnRecNo, lnOldSele
>m.lnOldRecno = RECNO (This.RecordSource)
>m.lnOldSele = SELECT()

>And after your code:
>IF BETWEEN (m.lnOldRecno, 0, RECCOUNT (This.RecordSource))
>    GO (m.lnOldRecno) IN (This.RecordSource)
>ENDIF
>SELECT (m.lnOldSele)

>Maybe you will need to add such code to other methods conserning your grid
>(as header click, right click) where you have custom code, as some of you
>commands may move record pointer, and some may switch workareas.

>WBR, Igor



Sun, 19 Dec 2004 00:06:47 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Error 1574 - Error initializing Application object

2. MouseDown hassles in VFP5

3. MouseDown problem

4. Repeat mousedown event

5. VFP 6: lostfocus nodefault and mousedown

6. VFP 6: .mousedown Firing

7. VFP application quit without error message

8. Error running custom Foxpro application

9. OLE Error: Application not found

10. Application Installation Error

11. Help with applications and table not found errors

12. OLE error when distributing Application

 

 
Powered by phpBB® Forum Software