修改拆分表单数据表视图格式

时间:2017-01-18 14:56:11

标签: forms ms-access access-vba subform expandable

我有一个包含子表单的拆分表单。每次加载表单时,子表单数据都会自动扩展。

是否有办法在表单加载时自动折叠子表单的数据表视图?

enter image description here

1 个答案:

答案 0 :(得分:1)

使用VBA在子窗体加载时自动折叠:

Dim strExpand As String

With Forms("Purchase Orders")

strExpand = InputBox("Expand subdatasheets? Y/N")

Select Case strExpand
    Case "Y"
        .SubdatasheetExpanded = True
    Case "N"
        .SubdatasheetExpanded = False
    Case Else
        MsgBox "Can't determine subdatasheet expansion state."
End Select

End With