Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to use SQL in Grid ?
Message
From
05/10/1998 15:54:09
 
 
To
05/10/1998 03:31:14
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00143788
Message ID:
00143996
Views:
32
If they can specify more than one field, rather than using "one textbox", you might want to think about a ComboBox or List of available fields correlating to the textbox and an "add criteria" button. For instance: Don't make them type "SearchTable.cLastName='SMITH'". Instead, populate an array. In the INIT method of the ComboBox put:

Dimension This.aFieldName[3,2]
This.aFieldName[1,1]="Last Name"
This.aFieldName[1,2]="SearchTable.dHire"
This.aFieldName[2,1]="Date of Hire"
This.aFieldName[3,2]="SearchTable.cLastName"
This.aFieldName[3,1]="Social Security #"
This.aFieldName[3,2]="SearchTable.cSSN"
This.Rowsource=This.aFieldName

The CLICK method of the button would have:
with This.Parent
.grdMyGrid.RecordSource='Select... where .cboMyCombo.aFieldName[.cboMyCombo.Listindex,2]=.txtMyTextbox.Value'
endwith

I don't believe users -- no matter how advanced -- should have to learn field names, keys, etc. A List of allowable values will make life easier for all.

jt

>In my form design, I have one textbox and one Grid. I want user input the condition for SQL in textbox. And I want my Grid Refresh the SQL condition after the user input the condition in textbox. Please suggest me how do I do ?
Previous
Reply
Map
View

Click here to load this message in the networking platform