FoxInCloud
Re: Problem calling a form with parameters
From: | Michele |
To: | Thierry Nivelet (FoxInCloud) |
Thanks
Please try
.RecordSource = ""
before
SELECT ... into Tab
As the form is already instantiated, with
.RecordSource = "Tab"
SELECT ... into Tab
makes the grid loose its columns
(VFP behavior)
LPARAMETERS nButton, nShift, nXcoord, nYcoordIF (Type('m.thisForm.wlHTMLgen') == 'L' AND m.thisForm.wlHTMLgen)RETURN .T.ELSELocal cValue, cTipoTabLocal cObject cObject = "This.Parent." + This.ControlName + ".Value" cValue = &cObject cObject = "This.Parent." + This.ControlName + ".TipoTab" cTipo = &cObjectexternalform FormTagen FormTaGen = thisform.wForm('_form_tagen',"wFormCallBack",cTipo,cValue)ENDIF
can you post the instruction b which you call this form?
thanks
I have one class (form's based) that receive as parameter the table i have to opend and show in a grid......or better i receive the kind of a table and on that table i have to make a Select ....From...Where... and show in the grid the resulting cursor...
I put all the code in the Init method, but the second time i call the form the grid is empty......
In the Init my code is this:
Lparameters cTipoTab, cValue, cOrderIfPcount()>0DoDefault()This.TipoTab = cTipoTab Use wdfPath + "TaGen" In 0Select Code, Des1 From TaGen Where Tipo = This.TipoTab Order By Code Into Cursor Tab ReadWrite Use In TaGenWith .Grid1 .RecordSource = "Tab" .Column1.ControlSource = "Tab.Code" .Column2.ControlSource = "Tab.Des1" .SetFocusEndWithEndif