General information
Category:
Forms & Form designer
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only