Accessing a form from 2 different forms with 2 different child-dialogs


Accessing a form from 2 different forms with 2 different child-dialogs...
Author
Message
Thomas Holste
Thomas Holste
StrataFrame User (360 reputation)StrataFrame User (360 reputation)StrataFrame User (360 reputation)StrataFrame User (360 reputation)StrataFrame User (360 reputation)StrataFrame User (360 reputation)StrataFrame User (360 reputation)StrataFrame User (360 reputation)StrataFrame User (360 reputation)
Group: StrataFrame Users
Posts: 144, Visits: 618
Hi there,

I have a form which I want two call from two different forms with two different child-dialogs. Say teher is Form1 with a BO called "BestBo1". I Add a child-dialog, add the same BO to the to-be-calles form and set the properties of the child-sialog. So far, so good.

Now I need the same form for data-entry to called from another form woth a different BO. I do the same, add a child-dialog and the BO ("karteiBo1") and set the properties. I call the form with a new-sub where I pass a parameter to see what form is the parent-form.

In the Load-Event I write something like



If me.cForm = "B"  ' Called from Form 1

   Me.PrimaryBusinessObject = BestBo1

   Me.txtKollege.Businessobject = BestBo1

   Me.txtkollege.BindingField ) BestBo1.Kollege

   ....' some more controls

Else

   Me.PrimaryBusinessObject = KarteiBo1

   Me.txtKollege.Businessobject = KarteiBo1

   Me.txtkollege.BindingField ) KarteiBo1.Kollege

   ....' some more controls

Endif



But this does not wotk. Whether I call it from Form1 or Form2, I get an out-of-range-error.

So can anyone tell me if I am doing something wrong or if that whole approach is wrong.

Thanks in advance

Thomas
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search