You always open tables or create cursors in the load event, unless you

pass a collection or a XML or a value to the form, by which you create a
cursor from a select based on the value passed. If you pass a collection
or an object you generate the cursor from those. In all three cases you
must use the init event of the form.

On the other hand, it is always better to call another form making this
one private data session, so whatever you do in that form does not mess
up anything in the calling form.

The fact that it is or not a modal form should not be the source of your
problem.

Remember that a grid is instantiated before the init of the form but
after the load event of the form, so it will not be populated unless you
open the tables first in the load event. If you have to open them in the
init of the form, then you must, after you open the tables or cursors,
do something like this, in the init of the form:

thisform.grid1.recordsource = 'thecursorjustcreated' and you might have
to populate the controlsource of each column of the grid with code like
this:

thisform.grid1.column1.controlsource = 'thecursorjustcreated.field1', etc

Rafael Copquin


El 25/10/2010 11:53, Stephen Weeks escribió:
>  Al,
>
>  Try to keep up (LOL)
>
>  This was continuing from a previous post, where I was having trouble
>  with a grid on a form, if I made the form modeless the grid went blank,
>  I found out that by making the datasession=Private and opening the
>  tables in the load event of the same form things went ok.
>
>  Regards
>  Steve
>
>  On Mon, 25 Oct 2010 11:34:27 +0200, "Allen"<[email protected]>
>  said:
>>  On a modeless form ? what ?
>>  Al
>>
>>  -----Original Message-----
>>  From: [email protected] [mailto:[email protected]]
>>  On
>>  Behalf Of Stephen Weeks
>>  Sent: 25 October 2010 10:06
>>  To: [email protected]
>>  Subject: Re: Grid problem
>>
>>
>>  Sussed it out after much trial and error (in other words googling), it
>>  turns out that you need to make the form datasession = 2 Private and
>>  open any tables in the load method, this allows grids on a a modeless
>>  form !
>>
>>  Cheers!
>>
>>
>>
[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to