Thanks for replying... (It must be the 45C (113F) we had on 1 January that fried the cerebral cortex).
I wrote a simple name finder routine for my database... it was supposed to use a sequential search (using InteractiveChange in a TextBox) and I used a comma as a separator for LastName and FirstName...
I detect the comma with
IF "," $ cLName
and hence generate cLName1 which is just the LastName and cFName which is the FirstName
I tried using
SET FILTER TO last_name = cLName1 .and. first_name = cFName
And putting the result into a grid and it worked FINE... but it was occassionally very slow (It was really slow on backspacing in the TextBox)and so I thought it was due to the SET FILTER ... hence the attempt to use a SELECT.. to go faster... (*** see note later)
Only problem is that I could not seem to populate the grid using SELECT and a temp cursor as easily as using the SET FILTER on the whole Table.
So that having been said.... You have SORT OF solved one problem..
In general, you can create a cursor (which is what your SELECT is doing), and use one or more of its fields to populate a grid. You do that by setting the grid's RecordSource to 1, its RecordSourceType to the name of the cursor, its ColumnCount to the number of fields you want to show, and the individual columns' ControlSource to the names of the fields. Is that what you are doing?
I set the grid's RecordSource to the name of the cursor (ie temp), and its RecordSourceType to 1 (I guessed it was wrong way around).. and ColumnCount to 1 and the ControlSource to (and I hope this is right) temp.patient_episode (?is the 'temp' right ?)
and it is nearly right....
AND NOW FOR THE *** NOTE LATER....
I thought SET FILTER was supposed to be fast... so I looked at my code again... and (doh !) I used COUNT to detect if there were any matches for the SET FILTER condition... AND I think that counts the whole database.... 100,000 records each time and that might cause the slowness...
... but returning to the SELECT.... I still have not completely nailed the Grids properties YET... the Header shows all the fields...
ANd I still haven't got a fast enough search,,, meaning my code is wrong somewhere,,,
Star for providing direction... Thanks... and happy NY
FoxEgg