Article ID: 139912
Article Last Modified on 2/10/2000
*-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
BEGIN CODE SEGMENT
*-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
SET DEFAULT TO C:\VFP\SAMPLES\DATA
oMyForm1=CREATEOBJECT('Form')
oMyDE1 =CREATEOBJECT('DataEnvironment')
oMyDE1.ADDOBJECT('Curs1', 'Cursor')
oMyDE1.Curs1.DataBase='TESTDATA.DBC'
oMyDE1.Curs1.CursorSource='Customer'
oMyForm1.ADDOBJECT('Txt1', 'TextBox')
oMyForm1.Txt1.ControlSource='Customer_ID'
oMyForm1.Txt1.Visible=.T.
*-- You can add as many objects as you want.
*-- Use the form's SaveAs method to save everything
*-- to an .scx File. This is actually how the DE
*-- is associated to the form.
oMyForm1.SaveAs('MyForm2', oMyDE1)
*-- Note that the second parameter specifies the
*-- associated Data Environment
RELEASE oMyForm1
DO FORM MyForm2
*-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
END CODE SEGMENT
*-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
You can also use the following command to open the form in design mode:
MODIFY FORM MyForm2
Additional query words: VFoxWin
Keywords: kbcode KB139912