>I have created a test form with a pageframe, various field textboxes, a grid, and a VCR button. The form works well, and I am using a series of related tables. My main table contains products, of which I have about 4000 records.
>I want to add a form-control to search by product.code or product.name (both of which are indexed). The data on the form should then be refreshed to show the data that if found.
>Which form control is best for this?
Option group (Product Code, Product Name)
Text box (Search text)
Command button (Find)
>What are the most simple lines of code I could use to get started?
>Where exactly should I place this code, and what else do I need to set on the property sheet of this control?
CommandButton.Click():
lcIndex = IIF(OptionGroup.Value = 1, "MainTableProductCodeIndex", "MainTableProductNameIndex")
IF Seek(Alltrim(TextBox.Value), "MainTable", lcIndex)
THISFORM.MyGrid.Refresh()
ENDIF