Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Button switches subform Datasheet --> Form view 1

Status
Not open for further replies.

bgv

Programmer
Sep 23, 2003
29
US
How can I set up a button on a master form to switch a subform from datasheet view to form view and then back again?
 
Try this in the OnClick event of the button (Assume that the name of the subform control is form1)

Form1.SetFocus
DoCmd.RunCommand acCmdSubformDatasheet
 
Perfect! This is just what I needed.

Private Sub btnSwitchFormView_Click()
frmStationActivitiesListSubform.SetFocus
DoCmd.RunCommand acCmdSubformFormView
Me.btnSwitchDSView.Visible = True
Me.btnSwitchDSView.SetFocus
Me.btnSwitchFormView.Visible = False
End Sub

Private Sub btnSwitchDSView_Click()
frmStationActivitiesListSubform.SetFocus
DoCmd.RunCommand acCmdSubformDatasheetView
Me.btnSwitchFormView.Visible = True
Me.btnSwitchFormView.SetFocus
Me.btnSwitchDSView.Visible = False
End Sub


Thanks a lot. Learning more every day
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top