Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Another question on GRids

Status
Not open for further replies.

rclarke

Technical User
May 14, 2001
78
GB
Hello

Those of you who are following the rachel saga will be please to know I got my SQL statement working properly

However I save the results of the SQL statement to a cursor results.

On my form I have a grid. You can guess what is coming next

The grid does not refresh properly it goes blank until I shut the form down and then reopen it Then it has the results in it. I know there are a million and one replies to this kind of question but could somebody take me through it please I know it has to do with where I put my refresh but where do I stick it.

Please see below the code in my button

SELECT Testdetails.tst_stest, Testdetails.tst_shortdesc,;
Testdetails.tst_ntype, Testsetdetail.*;
FROM data1!testdetails INNER JOIN data1!testsetdetail ;
ON Testdetails.tst_stest = Testsetdetail.tsd_stestid ;
WHERE testsetdetail.tsd_sname=thisform.distinct_values_combo2.value ;
ORDER BY testsetdetail.tsd_sName, testsetdetail.tsd_iline ;
INTO CURSOR filterResults
Thisform.Grid1.refresh

Thanks

Rachel
 
In the refresh of your grid or form set the controlsource to "" (blank) and then again to the controlsource you want e.g. "MyCursor".

Or try
Thisform.Grid1.Controlsource = SPACE(0)
Thisform.Grid1.Controlsource = "filterResults"

Thisform.Grid1.refresh

HTH,

Weedz (Wietze Veld) They cling emotionally to code and fix development rather than choosing practices based on analytical assesments of what works best. - Steve McConnell
 
Thank Weedz

but have tried this now in the refresh of both form and grid and it say property CONTOLSOURCE is not found.

Still come up as a blank grid.

Any other ideas would be much appreciated thanks
 
Hi Rachel,

Grids don't have a controlsource property. I'm sure Weedz meant recordsource. Try that.

Jim
 
Or you could just learn to use views which remove 99 percent of all the wierd problems with grids.
 
After the SQL SELECT commands.. and before ... refresh()..
put the code..

myAlias = ALIAS()

ThisForm.Grid1.RecordSource = myAlias()
.. then .. proceed with the code ...

Thisform.Grid1.refresh

I have ran into this type of weired thing that the Grid is losing its record source value... when the initial record source is not populated (but the grid is already instatiated with no records loaded view). I have worked around by reinstating the recordsource property and the error never poped up after that. So in fact I have in my base class itself identified this and a work around is put in my base class for the grid.

Hope this helps you.

ramani :-9
(Subramanian.G)
FoxAcc
ramani_g@yahoo.com
 
Thank you one and all

This is the first grid I have had this problem with and I use a few n this databse all works OK now

Thanks again for all your help
 
That is a little off-topic but I had the same problem and i've switched to view's wich are faster and more flexible with grid's.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top