Abbas
Abbas

Reputation: 75

Modify split form datasheet view format

I have a split form with a subform. Each time the form is loaded, the subform data expands automatically.

Is there a way to automatically collapse the datasheet view of the subform when the form loads?

enter image description here

Upvotes: 1

Views: 1109

Answers (1)

Abbas
Abbas

Reputation: 75

Use VBA to automatically collapse the subform when it is loaded:

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

Upvotes: 1

Related Questions