You can open the form as Hidden, then assign an appropriate Record Source
for the subform, and then make the form Visible.
Or you can pass the button name to another form using an OpenArgs parameter
of DoCmd.OpenForm method, then in the form's On Open event procedure assign
a Record Source depending on that parameter.
Viktor
Quote:
> Hello,
> Here is the scenario:
> -User can select to click either Button A or Button B.
> -After clicking either button, the program will open aother form with a
> subform in it.
> -If Button A is clicked, the subform will display selected fields from
Table
> A.
> -If Button B is clicked, the subform will display selected fields from
Table
> B.
> -The main form shares the same information. The only difference is in the
> subform.
> -Both Table A and B has seperate link field to the main Table (eg. Table
X).
> How do I solve this problem using in VBA? Pls help or any pointer is
> appreciated.
> Thank you.
> Choo.