Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Change view

4 views
Skip to first unread message

rob p

unread,
Oct 5, 2005, 3:09:44 PM10/5/05
to
I have a form (frmclient) used to enter / edit / add to a table (tblclient).
I also want this to be available in datasheet view. What's easier, just
having two forms each with a different default view or is there a way to use
a command button to change the view or maybe another way? Thanks.


Graham Mandeno

unread,
Oct 5, 2005, 8:10:03 PM10/5/05
to
Hi Rob

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...

MacDermott

unread,
Oct 5, 2005, 9:21:56 PM10/5/05
to
According to Access 2000 Help, CurrentView is a read-only property.
Has this changed in later versions?

"Graham Mandeno" <Graham....@nomail.please> wrote in message
news:uA7$IpgyFH...@TK2MSFTNGP14.phx.gbl...

Graham Mandeno

unread,
Oct 6, 2005, 12:42:43 AM10/6/05
to
To be honest, I don't know. Like I said, I avoid datasheet view.

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...

0 new messages