There's a lot of info missing here. First, is the WO form using a default datasession or a private datasession? And what's going on the the REFRESH()? I don't see anywhere in the code you've posted where you do anything with the PK that you passed to the form. If you don't change the record pointer according to the twoid you've passed, how can the displayed data change?
>Hey gurus,
>
>I have a grid that's populated with work orders (the main form). When I select
>a work order and click a "modify" button (it brings up a form called "wo"),
>I can modify the work order, save changes, cancel, and so forth. On the form "wo",
>I have button called "invoices" that pulls up another form called "inv," and
>this is where thing fall apart/break.
>
>
>Now, suppose I select work order # 1111 from the grid and hit the "modify" command button.
>Doing this selects that particular, unique record and brings up the "wo" form. Next I select
>the "invoices" command button, and the "inv" form pops up. Next I cancel out of this "inv" form
>and drop back to the "wo" form. Next I cancel out of "wo" and drop back to main form. Then I select
>another different work order(say 2222)from the grid for modification. When I do this, the "wo"
>form still pulls data related to the previuos work order (# 1111), and it doesn't pull up
>work order # 2222. The program is acting as if it's stuck on the original record and can't
>select a new work order.
>
>
>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
>
>
>
>This is the code in the init event of the form "wo."
>---------------------------------------------------
>
>
>
>LPARAMETERS twoid
>thisform.woid = twoid
>
>IF PCOUNT() = 0
>lnJn = wo.jn+1
>APPEND BLANK
>thisform.woid = SYS(2015)
>replace wi WITH thisform.woid IN wo
>replace jn WITH lnJn IN wo
>thisform.newwo = .T.
>SELECT wo
>TABLEUPDATE(.T.)
>
>ENDIF
>
>WITH this
>.txtAFE.controlsource = "wo.afe"
>.txtBlock.controlsource = "wo.bl"
>.txtRig.controlsource = "wo.rg"
>.txtBase.controlsource = "wo.sb"
>endwith
>
>thisform.refresh()
>
>
>
>What gives?
>
>Regards and TIA,
>
>Randall