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

Trouble Displaying Query Grid 1

Status
Not open for further replies.

xBaseDude

MIS
Jan 31, 2002
357
US
Good Morning...

I'm having trouble displaying the results of qry in a grid.

Form starts and displays white space at grid location.
Valid snippet of txtbox executes query.
Qry is successful.
Property of grid is set to query.
After Qry executes I follow with code ie...

SELECT * FROM mydbf INTO CURSOR qmydbf
THISFORM.REFRESH

White space is still white and qry result set is not displayed.

Any ideas?

TIA - Wayne
 
That is gird reconstruction problem.
That a look at this faq=faq184-937
Mike Gagnon
 
I had the same problem. Here's the solution:
every time you need the grid to display the qry, you have to reassign the RecordSource property of the grid.
That's all, you don't have to do some refresh or anything.
Good luck. Cristian
 
HI dude,

myGrid.RecordSource = ""
SELECT * FROM mydbf INTO CURSOR qmydbf
myGrid=RecordSource = "qMyDBF"
THISFORM.REFRESH

Hope this solves your problem :) ramani :)
(Subramanian.G),FoxAcc, ramani_g@yahoo.com
 
Gentlemen;

Thank-You for taking the time to reply.

As you know I am but a beginning VFP developer, and am continually learning as I go along.
As The Fixx sang "One thing leads to another..."

Let me explain my current dilema.

I created the FORM using the DE.
The txtbox that drives the query has a ControlSource pointing to the dbf and the field ie mydbf.myfield.

I have been laboring under the assumption that variable data was being held in a buffer above the table prior to actually being inserted into the table with a explicit INSERT, COMMIT, or TABLEUPDATE command.

Much to my chagrin, I am seeing the table being updated immediately from the textbox.

Ergo...the query is now always finding the variable in the table!

In prehistoric times of 26, I would open the table and then SCATTER MEMVAR BLANK to initialize my variables prior to displaying the FORM/screen.

What do I need to do set the fields to MEMVARs instead of the actual row data?

Regards - Wayne
 
Wayne,
You need to look into table buffering - don't even think about memvars! With buffering, THEN you'll have the opportunity to see the disk file not being updated until YOU do a tableupdate().

Rick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top