Subform in FormView vs Datasheet View

  • Thread starter Thread starter Rick's News
  • Start date Start date
R

Rick's News

How do I make my Subform display in FormView vs Datasheet View?

Thanks In Advance!

Rick
 
The easiest way is to change the defaultView property in the property sheet.
From code you can use DoCmd.RunCommand acCmdSubformDatasheetView *after* you
setfocus to the subform control. Here's some sample code that goes in a
button click event for a button on the main form:


Private Sub Command16_Click()
Static fdatasheet As Boolean
Me.order_subform.SetFocus
If fdatasheet Then
DoCmd.RunCommand acCmdSubformDatasheetView
Else
DoCmd.RunCommand acCmdSubformFormView
End If
fdatasheet = Not fdatasheet
End Sub
 
Back
Top