>Hi All:
> Need help on populating the grid with the cursor. Problem is that when the controlsource of the columns for the grid is tied to a table every thing is fine, however, when I try to populate the grid with the cursor all hell breaks lose. The issue is that when I click on the grid, all the columns on the grid gets populated with the very first record from the cursor. Thus, every record on the grid is the same as the every first record for the cursor.
>
>Thanks
Sounds like recordsource is not the cursor itself. I frequently use grids with cursors, create grids on the fly. For a simple example this would work if you have an index on upper(last_name) in table :
with this
.Recordsource = ""
.Columncount = -1
.Recordsourcetype = 4
.Recordsource = "select * from employee ;
where upper(last_name)=upper(trim(thisform.text1.value)) ;
into cursor crsGrid"
endwith
Then you could just code this in thisform.text1.lostfocus :
thisform.myGrid.Refresh
For a more detailed sample download gridx.zip from files\classes section and check init method of multiselectgrid class. It entriely works with cursors.
Cetin