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

Need Grid to Display Query Results.

Status
Not open for further replies.

NewTexasFox

Technical User
Mar 18, 2000
2
US
My problem is the grid on a form is not displaying the most recent query results. The query output destination is a table that is used as the RecordSourse for the grid. The query is run from a command button on the form.Thanks for the help.
 
Yes, I have tried thisform.grid.Refresh and after the query runs the grid is blank. I've also tried thisform.grid.RecordSourse=table.dbf and recieved a program error, Variable 'DBF' is not found.
 
How about brute force! Use addobject() and removeobject() methods to manually create grids that appear as needed on your form. The flexibility is a real plus. Create a temporary class with the specifics of what you want and then view the source. Paste that into your form.field(whatever).valid clause to call your dynamically created grid. <br>
<br>

 
&gt;&gt;I've also tried thisform.grid.RecordSourse=table.dbf and recieved a program error, Variable 'DBF' is not found. <br>
<br>
It sounds like it thought the .dbf was a field name or property. Did you try just thisform.grid.RecordSource=table (without the .DBF) and see if that worked? (By the way you keep saying RecordSouse - I assume you're really typing RecordSource?)<br>
<br>
Good luck - SK<br>

 
If it is blank you must reset the RecordSource = &quot;tablename&quot; each time the table is updated. The query will delete the exisitng table and create it anew each time you run the query. Once the table is deleted the grid's RecordSource link is dropped. You must restore it.<br>
<br>
To keep from losing the grid formatting you will need to direct RecordSource to an empty table with the same strucuture. Suppose your real table is called &quot;DATALIVESHERE&quot;. Query out an empty table (e.g. &quot;NODATAHERE&quot;) with the exact strucuture your real table will have. Point the grid to &quot;NODATAHERE&quot;; then do the query; then point the grid back to &quot;DATALIVESHERE&quot;.<br>
<br>
The .DBF problem I believe is because you are not putting the table name in quotes. Fox is interpresting your table.dbf as tablename.fieldname so it looks in the table for a field called dbf.<br>
<br>

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top