Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Textbox and Grid
Message
From
29/07/2010 04:16:48
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01474406
Message ID:
01474413
Views:
40
>I have what follows:
>SELECT ;
> EmployeeName ;
> FROM Employees ;
> WHERE "Smith" $ EmployeeName ;
> INTO TABLE Results
>
>and works well, In a Form, I have a Textbox and a Grid, in the validate method of the Textbox insert the code above, the problem is that the Grid resulting data does not appear, however, when I browse the Results table The data is there, can anyone help please?
>Thanks

If the data is not large:
Public oForm
oForm = Createobject('SampleForm')
oForm.Show()

Define Class SampleForm As Form
  DataSession = 2
  Height=300
  Width=500

  Add Object txtName As TextBox With Top = 10, Left = 10
  Add Object myGrid As Grid With Top=40,Height=260,Width=500,Anchor=15

  Procedure Load
    Select contact As EmployeeName ;
      FROM (_samples+'data\customer') ;
      INTO Cursor Employees ;
      nofilter
    Use In 'customer'
  Endproc

  Procedure myGrid.Init
    With This
      .RecordSourceType = 4
      .RecordSource = "SELECT EmployeeName " +;
        "  FROM Employees "+;
        "  WHERE UPPER(EmployeeName) like ?m.SearchName" +;
        "  INTO cursor crsResults nofilter"
    Endwith
  Endproc

  Procedure txtName.InteractiveChange
    Local SearchName
    SearchName = '%'+Upper(Trim(This.Value))+'%'
    Thisform.myGrid.RecordSource = Thisform.myGrid.RecordSource
  Endproc
Enddefine
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform