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!

Grid: Bug or Feature

Status
Not open for further replies.

DEDMOD

Programmer
Feb 1, 2001
721
US
Though I think I know how to solve this, having read the recent "Problem with Grid" thread, I wonder if someone can explain what's happening in the following situation.

I have a 'main' form which calls another, data-entry form. I've placed a grid on this data-entry form to show related information from a different table than the one the data's being entered into. Right now, when I pull up (make visible) the grid, it's just a white space, and that's want I think the information in the thread mentioned will solve. But I also find that when I re-run the program or enter the 'main form' again, and again switch to the data-entry form, a 'grid' appears covering the 'main form and it just sits there till I close it. Then the Data-Entry form (which is larger than the 'main form') appears - with the (blank) Grid where it's supposed to be.

I assume the SQL statement I'm using to populate the grid isn't being closed or released as it should be, but why does the thing(cursor or whatever it is) appear on the parent form instead of the child form, and only when I press the button to bring up the child? I assume it has to do with the order things are done in instantiating the form, but is this really the right way for things to work?
 
Your mystery Grid sounds like a browse window... are you issueing a BROWSE command without the NOWAIT clause?

Or your SQL statement is not going to a named alias cursor, but rather to the generic alias query hence the creattion of default browse grid that you must close to continue the program.

Just my 2 cents. Hope it helps.
-Pete
 
Definitely the latter. I'm not issuing a Browse command. But I'm also not telling the SQL select where to be put.

I got rid of the grid in the 'main form' by not setting the recordsource until I need it, but I still get it in the Data-entry Form. Do I need to assign the SQL Select to a cursor or something even though I'm typing something like ?

Code:
 thisform.mygrid.recordsource = SELECT <field 1, ...field n> FROM MyTable A WHERE A.ThisProject = vCurrentProject
 
Yes! I have no doubt now that is what is causing it.
Change your record source type to ALIAS
Build your query when ever and where ever but assign it an alias name.

thisform.mygrid.recordsource = &quot;AliasName&quot; Should resolve your browse window appearing

Enjoy!

-Pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top