You should be able to switch between views using this code:
If Me.CurrentView = acCurViewFormBrowse Then
Me.CurrentView = acCurViewDatasheet
Else
Me.CurrentView = acCurViewFormBrowse
End If
Personally, I avoid datasheet view and instead use a continuous form. These
are much easier to format the way you want, and can contain headers and
footers with command buttons and other controls. For this, of course, you
would need to create two forms - one for single record details and one for
"list view".
--
Good Luck!
Graham Mandeno [Access MVP]
Auckland, New Zealand
"rob p" <nospam*w...@stans.net> wrote in message
news:eIb1D%23dyFH...@TK2MSFTNGP14.phx.gbl...
"Graham Mandeno" <Graham....@nomail.please> wrote in message
news:uA7$IpgyFH...@TK2MSFTNGP14.phx.gbl...
However, this should certainly work:
If Me.CurrentView = acCurViewFormBrowse Then
DoCmd.RunCommand acCmdDatasheetView
Else
DoCmd.RunCommand acCmdViewFormView
End If
--
Good Luck!
Graham Mandeno [Access MVP]
Auckland, New Zealand
"MacDermott" <macde...@NoSpam.com> wrote in message
news:%23R0KXRh...@TK2MSFTNGP10.phx.gbl...