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

How to avoid grid reconstruction

Grids

How to avoid grid reconstruction

by  Mike Gagnon  Posted    (Edited  )
To avoid reconstruction when refreshing grid's record source, you require to assign empty string (not a one space - " ", but empty string - "") to the Record source before any of grid's record source refresh actions described above. If you already do that, just check your code if you do that in correct order or any other thing does not spoil the correct order of refreshing process. After refresh assign record source to grid again.

In order to reset the grid recordsource dynamically set the recordsourcetype to Alias(1), and use the grid refresh method. Call the grid refresh method every time you need to update the data. In the grid refresh use something like:
Code:
thisform.grid1.recordsource="" && To avoid reconstruction
select * from table2 where table2.key=field2 INTO myCursor
thisform.grid1.recordsource="myCursor"
DODEFAULT() && To do the rest of the refresh

Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top