From: Neil on
In Access 2003, I have a form with four distinct subforms. When I open
the main form in datasheet view, the first subform is available as a
subdatasheet.

1) How do a specify a different subform to be used as the
subdatasheet?

2) The subform originally opens in form view when the subdatasheet is
expanded and it appears. Is there a way to have it appear in
datasheet view instead?

Thanks.
From: Krzysztof Naworyta on
Neil wrote:
| In Access 2003, I have a form with four distinct subforms. When I open
| the main form in datasheet view, the first subform is available as a
| subdatasheet.
|
| 1) How do a specify a different subform to be used as the
| subdatasheet?

Change SourceObject of the first subform instead:

Me.sfrm1.SourceObject = "frmFormB"


| 2) The subform originally opens in form view when the subdatasheet is
| expanded and it appears. Is there a way to have it appear in
| datasheet view instead?

DoCmd.OpenForm "FormA", acFormDS

--
KN
From: Neil on

> | 1) How do a specify a different subform to be used as the
> | subdatasheet?
>
> Change SourceObject of the first subform instead:
>
> Me.sfrm1.SourceObject = "frmFormB"
>

You're saying that Access will always use the first subform as the
form's subdatasheet, and there's no way to speciy a different one
apart from changing the source object of the first subform control??

> | 2) The subform originally opens in form view when the subdatasheet is
> | expanded and it appears. Is there a way to have it appear in
> | datasheet view instead?
>
> DoCmd.OpenForm "FormA", acFormDS
>

No, I mean when the subform is opened as a subdatasheet, not when it's
opened by itself.
From: Krzysztof Naworyta on
Neil wrote:
||| 1) How do a specify a different subform to be used as the
||| subdatasheet?
||
|| Change SourceObject of the first subform instead:
||
|| Me.sfrm1.SourceObject = "frmFormB"
||
|
| You're saying that Access will always use the first subform as the
| form's subdatasheet, and there's no way to speciy a different one
| apart from changing the source object of the first subform control??

I can not find SubdatasheetName property in form properties, even in hidden
members...

||| 2) The subform originally opens in form view when the subdatasheet
||| is expanded and it appears. Is there a way to have it appear in
||| datasheet view instead?
||
|| DoCmd.OpenForm "FormA", acFormDS
||
|
| No, I mean when the subform is opened as a subdatasheet, not when it's
| opened by itself.

Change its DefaultView if you can.
Or after opening it run this code:

Me.sfrm1.SetFocus
DoCmd.RunCommand acCmdSubformDatasheetView

---
KN