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 dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing the default view of a subform in vba

Status
Not open for further replies.

crazytrain506

Programmer
Mar 1, 2007
1
US
Hi,

I have a subform that I want to show on two different tabs. When on the first tab I want the subform view to be Datasheet and on the second tab to be in Continuous Form view. Is there a way for me to close the subform, edit the default view, and reopen it when changing from the first tab to the next? This is what I've got so far:

Private Sub mainform_eventTab2Clicked
DoCmd.Close acForm, "mysubform"
DoCmd.OpenForm "mysubform", acDesign, , , acFormPropertySettings, acHidden
mainform.Subform.Form.DefaultView = 1
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top