A
Alex
I have a form where I want the user to be able to click on a checkbox to toggle
between DataSheet and Single Form views. Unfortunately when the code executes,
I get run-time error 2136: "To set this property, open the form or report in
Design view". How can I change the DefaultView at run-time? The click event
for the form is as follows:
Private Sub CheckBoxViewList_Click()
If Me.CheckBoxViewList Then
Me.DefaultView = 2 ' DataSheet
Else
Me.DefaultView = 0 ' Single Form
End If
End Sub
between DataSheet and Single Form views. Unfortunately when the code executes,
I get run-time error 2136: "To set this property, open the form or report in
Design view". How can I change the DefaultView at run-time? The click event
for the form is as follows:
Private Sub CheckBoxViewList_Click()
If Me.CheckBoxViewList Then
Me.DefaultView = 2 ' DataSheet
Else
Me.DefaultView = 0 ' Single Form
End If
End Sub