Change the Display of a Subform
acCmdSubformDatasheetView, acCmdSubformFormView
This code was posted by the Access MVP Brendan Reymolds on the microsoft.public.Access newsgroup.
'***************** Code Start *******************
Private Sub Command1_Click()
Me.NameOfSubformControl.SetFocus
'1 = form view, 2 = datasheet view ...
If Me.NameOfSubformControl.Form.CurrentView = 1 Then
DoCmd.RunCommand acCmdSubformDatasheetView
Else
DoCmd.RunCommand acCmdSubformFormView
End If
End Sub
'****************** Code End ********************