Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to display fields of table on the grid and select its
Message
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
How to display fields of table on the grid and select its
Miscellaneous
Thread ID:
00871218
Message ID:
00871218
Views:
60
Hi All,
i wantto design a query form such as users can be select the fields from the grid and then run query .
for this target i've created a form like codes below but at the end of i couldn't create SQLString for selected fields. How can i do this ?
* form init
Create Cursor flds (Choice N(1),fld_name c(20),fld_Type c(1),;
	fld_length N(10))

Select * From data03\okul2 Into Cursor CrsOkul2

gnFieldcount = Afields(gaMyArray)  
Clear
For nCount = 1 To gnFieldcount
	lcfldname=gaMyArray(nCount,1) && name
	lcfldtype=gaMyArray(nCount,2) &&type
	lcfldlen=gaMyArray(nCount,3) &&len
	Select flds
	Insert Into flds(choice,fld_name,fld_type,fld_length) Values ;
		(1,lcfldname,lcfldtype,lcfldlen)
Endfor

this.grid1.RecordSource ="flds"
this.Refresh  

With Thisform.Grid1
	.Columns(1).RemoveObject('text1')
	.Columns(1).Newobject('_checkbox1','_checkbox','lib\_base.vcx') 
	.Columns(1).CurrentControl='_checkbox1'
	.Columns(1)._checkbox1.Visible=.T.
	.Columns(1)._checkbox1.Caption='Choice'
	.Columns(1).Sparse=.F.
	.autofit 
	.refresh
Endwith
* show selected fields button code
SELECT fld_name from flds WHERE flds.choice=1 INTO CURSOR CrsSelected
browse
Next
Reply
Map
View

Click here to load this message in the networking platform