Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to add table to the form DE at runtime
Message
From
09/10/2004 08:03:26
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00950084
Message ID:
00950144
Views:
12
>Hi All,
>i wantto do a search form for customer list,stock codes etc. when user need them while entering data. by the normal way i can create for each target a form and can put them tables of these forms. but i wantto do a specific and parametrik form. eg. user will describe some variables from start and will call the form with these variables. then form execute the commands as a parameters. by this issue i can put at runtime or design time properties to the form but i couldnt put table to the form DataEnvironment . how can i do this ?
>
>sample code
>
>
>local lctable,lcindex,lcfield,lcsearch
>
>lctable="stocks"
>lcIndex="code"
>Lcfield="code"
>Lcsearch=""
>
>do form SrchForm with m.lctable,m.lcIndex,m.Lcfield,m.Lcsearch
>
>* form is modal
>* form init
>lparamaters lctable,lcindex,lcfield,lcsearch
>
>with this.grid1
>.recordsource=m.lctable
>.refresh
>endwith
>
>* form unload
>lcsearch=m.lctable+"."+m.lcfield
>return m.lcfield
>
>
>
>what should i do extra ? for return value from form actions ? i wantto do it everything via paramaeters by this way i'll use only one search form for these targets ...
>
>TIA

Soykan,
Obviously you didn't try to run that code.
*Form.init - private datasession
lparameters m.tctable,m.tcIndex,m.tcfield,m.tcsearch
this.AddProperty('cEval',ForceExt(m.tcTable,m.tcField))
this.AddProperty('uRetValue',.null.)
use (m.tcTable) order tag (m.tcIndex)
this.grid1.RecordSource=m.tcTable

*Grid.AfterRowColChange
lparameters nColIndex
thisform.uRetValue = eval(thisform.cEval)

*Form unload
return this.uRetValue
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform