dbTalk Databases Forums  

Switch Between Form View and Datasheet View

comp.databases.ms-access comp.databases.ms-access


Discuss Switch Between Form View and Datasheet View in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Barry Edmund Wright
 
Posts: n/a

Default Switch Between Form View and Datasheet View - 04-26-2010 , 10:21 AM






Hi All,

I have a subfrm on a form. When on the subfrm I can go to the Access
Menu/View/Subform and switch between form and datasheet view. How do I
do this using VBA?

I see lots of similar posts pointing to:
http://www.tkwickenden.clara.net/codeex/282.htm
but that link is no longer available.

Thanks for your assistance.

Cheers,
Barry

Reply With Quote
  #2  
Old   
Barry Edmund Wright
 
Posts: n/a

Default Re: Switch Between Form View and Datasheet View - 04-26-2010 , 11:19 AM






On Apr 26, 11:21*am, Barry Edmund Wright
<barry.edmund.wri... (AT) witstoronto (DOT) ca> wrote:

Thanks, figured this out:
Under a button on the main form I simply put:

If Form_subfrmClients2.CurrentView = acCurViewDatasheet Then '2
Datasheet View
Me.subfrmClients2.SetFocus
DoCmd.RunCommand acCmdSubformFormView
ElseIf Form_subfrmClients2.CurrentView = acCurViewFormBrowse Then '1
Form View
Me.subfrmClients2.SetFocus
DoCmd.RunCommand acCmdSubformDatasheetView
End If

Cheers,
Barry


Quote:
Hi All,

I have a subfrm on a form. When on the subfrm I can go to the Access
Menu/View/Subform and switch between form and datasheet view. How do I
do this using VBA?

I see lots of similar posts pointing to:http://www.tkwickenden.clara.net/codeex/282.htm
but that link is no longer available.

Thanks for your assistance.

Cheers,
Barry

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.