Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Form not getting refreshed
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Title:
Form not getting refreshed
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01151360
Message ID:
01151360
Views:
83
hey all,
i have a grid that's populated with work orders.. When I select a work order and click a "modify" button(it brings up a form called "wo"), i can modify the work order. On the form "wo" i have button called "invoices" that pulls up another form called "inv".This is when the problem starts.. suppose i select a work order # 1111 and hit the "modify" button and then the "invoices" button , the "inv" form pops up. suppose i cancel out of this "inv" form and select another work order(say 2222) for modification, the "wo" form still pulls data related to the previuos work order 1111.

This is the code in the click event of the "modify" button:
---------------------------------------------------------------------

womod = createobject("mysql_mod",ALLTRIM(myserver),ALLTRIM(myUser),ALLTRIM(myPass),"test")--> Mysql DB
womod.selectcmd = oWo.iniselect + " where wi = '" + ALLTRIM(worder_cur.wi)+"'" --> sql query for Mysql
womod.cursorrefresh()
womod.cursorfill()
DO FORM wo WITH worder_cur.wi--> worder_cur.wi is the primary key of the "WO" table in Mysql

why this behavior even if i do a cursorRefresh???

this is the code in the init event of the form "wo"
code---------------------------------------------------

LPARAMETERS twoid --> this is the primary key of the work order being passed
thisform.woid = twoid

IF PCOUNT() = 0 -->if no parameter is passed then it is a new work order
lnJn = wo.jn+1 --> here jn is the work order number in the table wo
APPEND BLANK
thisform.woid = SYS(2015)
replace wi WITH thisform.woid IN wo ---->wi is the primary key
replace jn WITH lnJn IN wo
thisform.newwo = .T.
SELECT wo
TABLEUPDATE(.T.)


ENDIF

WITH this
.txtAFE.controlsource = "wo.afe" ---> populating the textboxes with data..
.txtBlock.controlsource = "wo.bl"
.txtRig.controlsource = "wo.rg"
.txtBase.controlsource = "wo.sb"
endwith

thisform.refresh()
Reply
Map
View

Click here to load this message in the networking platform