Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 1st, 2004, 10:03 AM
Authorized User
 
Join Date: Sep 2004
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default Hide Subform Using Option Group

Hi Expert,

I am unable to hide subform from masterform using option group. The subform still be displayed in masterform althrough applying Docmd.close... Can you give me a help?

Here is my coding:
Private Sub opt_trans_AfterUpdate()

Dim ctl As Control

    Select Case opt_trans.Value
      Case 1

         DoCmd.Close acForm, "trans_sell subform", acSaveYes
         DoCmd.Requery

      Case 2

         DoCmd.Close acForm, "trans_buy subform", acSaveYes
         DoCmd.Requery

      Case 3

         DoCmd.Requery

   End Select

End Sub


Thanks and Best Regards,
Martin :D:D:D





 
Old October 3rd, 2004, 10:48 AM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 625
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to jemacc
Default

open your trans_sell subform in design view and do the following

1-Set the AllowEdits property of the subform to Yes
2-Set the OnClick property of the command or toggle button to the following event procedure:

Sub cmdToggle_Click()
   Me![trans_sell subform].Visible = _
      Not Me![trans_sell subform].Visible
End Sub
I hope this helps






Similar Threads
Thread Thread Starter Forum Replies Last Post
Create Check Boxes/Option buttons/Option Group hewstone999 Access VBA 1 March 14th, 2008 07:25 AM
Option Group Variables (from Form to Module) emanuele.musa VB How-To 1 July 20th, 2007 03:58 PM
Option group vnadig Access 6 September 8th, 2004 02:53 PM
How to deselect "Option Group" box? reindeerw Access 6 May 11th, 2004 06:46 AM
Option Group Procedures Mr.Crud Access VBA 7 February 12th, 2004 06:45 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.