Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do you search a form
Message
From
30/11/1997 14:07:49
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00062921
Message ID:
00062930
Views:
23
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform