G
George Nicholson
This won't change DefaultView (I'm not sure you can), but you can change the
view at runtime (if ViewsAllowed is set to Both)
if ctlSubform.Form.CurrentView = 1 Then form is currently in FormView
(read-only)
if ctlSubform.Form.CurrentView = 2 Then form is currently in Datasheet View
to toggle to the "other" view:
ctlSubform.SetFocus
DoCmd.RunCommand acCmdSubformDatasheet
There may be a more elegant way to do this but this is the only way I found
that is compatible with Access 97 thru 2002(XP).
HTH,
George Nicholson
Remove 'Junk' from return address.
in design view. Any suggestions on how to do this using VBA?
view at runtime (if ViewsAllowed is set to Both)
if ctlSubform.Form.CurrentView = 1 Then form is currently in FormView
(read-only)
if ctlSubform.Form.CurrentView = 2 Then form is currently in Datasheet View
to toggle to the "other" view:
ctlSubform.SetFocus
DoCmd.RunCommand acCmdSubformDatasheet
There may be a more elegant way to do this but this is the only way I found
that is compatible with Access 97 thru 2002(XP).
HTH,
George Nicholson
Remove 'Junk' from return address.
(actually a subform). I am unable to change the Defaultview property exceptStephen Powers said:I would like to allow my users to change the default view of a form
in design view. Any suggestions on how to do this using VBA?