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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Grid will not refresh 1

Status
Not open for further replies.

wilfranz

Technical User
Oct 4, 2003
122
0
0
US
Hello friends,

I have a grid on Form (actually on a Form > Pageframe > Page) which does not refresh when expected.

The grid's RowSource is an SQL select from the source table TEMPDATA. The code to refresh the source table for the grid is:

Code:
DO FORM changefilter to cNewfilter	
   *Returns a valid filter string

*Zap the old records in the source table. (Allows the data
*binding to remain undisturbed.)
SELECT tempdata				
ZAP

*Make up & Run new Append command with new filter
cCmdStr = "APPEND from cardata for " + cNewFilter	
* Append the new filtered records
&cCmdStr	
			
*BROWSE   && A development check-view (see note below)
thisform.Refresh()

The BROWSE line was placed there as a development check-view to see if the table has indeed been filtered, and this works as expected to this point. I.e. the source table is properly filtered. But after the Refresh is issued the grid remains unchanged. It also will not refresh if the command is issued directly to:

Code:
Thisform.Pageframe1.Page1.Grid1.Refresh().

What am I missing here?

TIA,

BillvV




 
Reset your recordsource of your grid

Code:
Thisform.Pageframe1.Page1.Grid1.recordsource=''
SELECT tempdata                
ZAP
cCmdStr = "APPEND from cardata for " + cNewFilter    
&cCmdStr    
       
Thisform.Pageframe1.Page1.Grid1.recordsource='temdata'
thisform.Refresh()



Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Thanks a million, Mike.

That was it. It certainly isn't intuitive, and I can't figure why that reset action isn't performed by the Refresh. I had searched for 30-45 minutes for some clue and found none in many different docs. Deserves a star for "exotic esoterica". A great save!

Bill
 
Bill said:
found none in many different docs

Sometimes it pays to check here first;-) Faq184-1813

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Yep, I get it...

Tek-Tips = UrDocumentation!

Bill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top