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
subform
>should either be subform A or subform B.
>
>My first idea was to use the following code for on
>mainform.current:
>
>if ... then
>me.enabled=false
>subform.sourceobject = subform A
>me.enabled=true
>
>However, I get a type mismatch error because the
>sourceobject property seems to be read-only.
>
>Who can enlighten me?
>
>Thanks,
>Lorenz
>.
>