Board index » delphi » Problems with MDI and tables, help me...

Problems with MDI and tables, help me...

I have a litle MDI application D3 C/s, create a Table in dinamic form
(already exist the field too, each MDI form  with his data in their
table)  In the MDI call another form, since this last form I
attempting access to the table create in the MDI form, but result an
Access violation  Why ?
The code is it :
       EditForm.Table1.First;

Another question, I create others MDI forms and the name are :
EditForm_1, EditForm_2, EditForm_3 ... and so successively
How can I acces them ? because the name change and only the name
EditForm es the unique registered form into begin the application ?

Please reply me to :  LBa...@LatinMail.com

Thanks

Luis Enrique

 

Re:Problems with MDI and tables, help me...


On Wed, 07 Feb 2001 15:32:09 -0500, Luis Banda <LBa...@LatinMail.com>
wrote:

Quote
>Access violation  Why ?
>The code is it :
>       EditForm.Table1.First;

Are you sure that the created TEditForm subclass is assigned to the
EditForm global variable?  If you let Delphi autocreate the forms for
you, they'll be assigned to the global variable with the same name as
the specific class.

Quote
>Another question, I create others MDI forms and the name are :
>EditForm_1, EditForm_2, EditForm_3 ... and so successively
>How can I acces them ? because the name change and only the name
>EditForm es the unique registered form into begin the application ?

If you need to access a component or attribute of a specific TForm or
TEditForm subclass, you'll have to test for the class and typecast to
it, e.g.:
  if TheForm is TEditForm_1 then
    with TEditForm_1(TheForm) do
    begin
       ...
    end;

If you're accessing attributes common to all TEditForm or TForm
subclasses, you can use a variable of the parent class type to access
them.

HTH,

Jan

Re:Problems with MDI and tables, help me...


No, all Ok, the others components are acceced from Form3 but the Tables
NO,
what doing ?
***
Quote
Jan Sprengers wrote:
> On Wed, 07 Feb 2001 15:32:09 -0500, Luis Banda <LBa...@LatinMail.com>
> wrote:

> >Access violation  Why ?
> >The code is it :
> >       EditForm.Table1.First;

> Are you sure that the created TEditForm subclass is assigned to the
> EditForm global variable?  If you let Delphi autocreate the forms for
> you, they'll be assigned to the global variable with the same name as
> the specific class.

> >Another question, I create others MDI forms and the name are :
> >EditForm_1, EditForm_2, EditForm_3 ... and so successively
> >How can I acces them ? because the name change and only the name
> >EditForm es the unique registered form into begin the application ?

> If you need to access a component or attribute of a specific TForm or
> TEditForm subclass, you'll have to test for the class and typecast to
> it, e.g.:
>   if TheForm is TEditForm_1 then
>     with TEditForm_1(TheForm) do
>     begin
>        ...
>     end;

> If you're accessing attributes common to all TEditForm or TForm
> subclasses, you can use a variable of the parent class type to access
> them.

> HTH,

> Jan

Re:Problems with MDI and tables, help me...


On Sat, 10 Feb 2001 19:38:32 -0500, Luis Banda <LBa...@LatinMail.com>
wrote:

Quote
>No, all Ok, the others components are acceced from Form3 but the Tables
>NO,
>what doing ?

Sorry, but I don't understand what your problem is based on this
description.

Jan

Other Threads