[AccessD] A2K: How to change subform view

William Hindman dejpolsys at hotmail.com
Fri Jun 10 09:41:01 CDT 2005


Bruce:

..Matty's code is correct:

DoCmd.RunCommand acCmdSubformFormView
..switches the Subform to FormView.

DoCmd.RunCommand acCmdSubformDatasheetView
..switches the Subform to DatasheetView

DoCmd.RunCommand acCmdSubformDatasheet
..toggles between the 2 views.

..hth :)

William

----- Original Message ----- 
From: "Bruen, Bruce" <Bruce.Bruen at railcorp.nsw.gov.au>
To: "Access Developers discussion and problem solving" 
<accessd at databaseadvisors.com>
Sent: Friday, June 10, 2005 1:54 AM
Subject: RE: [AccessD] A2K: How to change subform view


> Michael,
>
> Both your Docmds are the same?????
>
>
> bruce
>
> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com
> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Michael R
> Mattys
> Sent: Friday, 10 June 2005 12:38 PM
> To: Access Developers discussion and problem solving
> Subject: Re: [AccessD] A2K: How to change subform view
>
> ----- Original Message -----
> From: "Bruen, Bruce" <Bruce.Bruen at railcorp.nsw.gov.au>
> To: <AccessD at databaseadvisors.com>
> Sent: Thursday, June 09, 2005 10:25 PM
> Subject: [AccessD] A2K: How to change subform view
>
>
> Hi guys again,
>
> Memory has failed me.  In Access 2000, what is the code trick to change
> the subform view from datasheet to normal?
> The following 2003 code does not work.
>
> Private Sub Test_DblClick(Cancel As Integer)
>    DoCmd.RunCommand acCmdSubformFormView
> End Sub
> --------- 
>
> bruce
>
>    'Form to Datasheet (It's a subform)
>    If Me.Customers.Form.CurrentView = 1 Then
>        Me.Customers.SetFocus
>        DoCmd.RunCommand acCmdSubformDatasheet
>    End If
>
>    'Datasheet to Form
>    If Me.Customers.Form.CurrentView = 2 Then
>        Me.Customers.SetFocus
>        DoCmd.RunCommand acCmdSubformDatasheet
>    End If
>
> ----
>
> Michael R. Mattys
> Mattys MapLib for Microsoft MapPoint
> http://www.mattysconsulting.com
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>
>
> This e-mail and any attachments may contain confidential information that 
> is intended solely for the use of the intended recipient and may be 
> subject to copyright. If you receive this e-mail in error, please notify 
> the sender immediately and delete the e-mail and its attachments from your 
> system.  You must not disclose, copy or use any part of this e-mail if you 
> are not the intended recipient.  Any opinion expressed in this e-mail and 
> any attachments is not an opinion of RailCorp unless stated or apparent 
> from its content. RailCorp is not responsible for any unauthorised 
> alterations to this e-mail or any attachments. RailCorp will not incur any 
> liability resulting directly or indirectly as a result of the recipient 
> accessing any of the attached files that may contain a virus.
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> 



More information about the AccessD mailing list