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 Woes

Status
Not open for further replies.

spuppett

Programmer
Jan 25, 2003
48
0
0
US
I'm still pretty new to VFP but not to programming. I have to add on to a legacy program and am having a heck of a time with a grid. I set it up with the recordSource, all the columns have their controlSource's property set. On the form are a few textboxes and a 'Search' button. When I click Search, I build a query based on the text boxes and that part is OK. The only way I found to actually display the query is to reset the grids recordSource property, but this causes the formatting and stuff to pretty much go to the way-side.

Do I really have to do that? and if I do, I presume I'll have to reset all the column headers, and the columns controlSource.

Anyone have any thoughts??
 
I have used the method of setting RecordSource to "" and it mostly works.

In the last year or so I've picked up on a more reliable way of doing this - direct your query to a temporary table (make sure that the structure is the same as that of the grid's RecordSource).

Zap the RecordSOurce and append from the temporary table.

This has value especially when the columns displayed are in a different order from the fields in the RecordSource or you don't want to display all the fields in the RecordSource.

Must confess I don't always do that :)

Hope that helps,

Stewart
PS If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top