Information générale
Catégorie:
Gestionnaire d'écran & Écrans
>>Here's an update. My form is based on a browse form class (which is based
>>on a base form) which has the above .Init code, a grid with .ColumnCount =
>>-1 and no RecordSource. When I use this form class, I put a table in the
>>DE, set .AutoOpenTables to .F. (so the code in my datafolder class above
>>will work), and set the grid.Recordsource = mytable. This works, until I
>>set .ColumCount > 0 and make some columns with .ControlSource =
>>mytable.myfield. Then it says "alias 'mytable' not found" before it can
>>execute any of the Form.Load code. Moving the Form.Load code from the
>>class to the form itself made no difference.
>>
>>I had an idea. I just made a similar form, but this time I used my base
>>form and put a grid on it, rather than using a form class with a grid
>>already in it. Everything else is the same. Now it works. So I basically
>>had to get the grid out of my browse form class, and put a unique grid in
>>each instance. That's fine, but why did this happen?
>
>Seems to me that when grid was in the class definition, it had to be
>instantiated earlier, i.e. before any of the events on the form; when it
>was on the form, it was treated as an object which could be data bound,
>so it was instantiated after setting up the DE, so when it's init fired
>in the first place, it fired before the DE, and found no tables at all.
>
>Just guessing. What would Sherlock say to this?
When .AutoOpenTables was .T., it was working. But I don't know what Sherlock would say.
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement