As a workaround I've simply put subform A and B into the
main form. Depending on the record one of the two is now
enabled. I guess that's the easiest way to achieve my
goal. Regards, Lorenz

>-----Original Message-----
>Dear all,
>I have a form containing one subform.
>What I want to achieve is:
>Depending on the record shown in the main form the
>should either be subform A or subform B.
>My first idea was to use the following code for on
>if ... then
>subform.sourceobject = subform A
>However, I get a type mismatch error because the
>sourceobject property seems to be read-only.
>Who can enlighten me?