Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / July 2005

Tip: Looking for answers? Try searching our database.

Forms and Subforms

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Steve Voorhees - 26 Jul 2005 12:26 GMT
I have a form that has 2 embedded subforms on it.  I also have 2 toggle
buttons on the form.
What I am curious about is whether there is a way that I could have both
subforms "hidden" unless the appropriate toggle button is clicked.  For
example, if Toggle1 is clicked then it would display subform1, and subform2
would remain hidden.  However, if Toggle2 is clicked, then subform1 would
remain hidden and subform2 would display.
Doogle - 26 Jul 2005 13:48 GMT
Hi Steve,

Yes, it's quite an easy one.

Create an 'on change' event for the selection group that contains the two
toggle buttons. The coding runs like this:

DoCmd.RunCommand acCmdSaveRecord
Select Case Me!OptionGroup
   Case 1
         Me!Subform1.Visible=True
         Me!Subform2.Visible=False
   Case 2
         Me!Subform1.Visible=False
         Me!Subform2.Visible=True
End Select

(If the buttons aren't part of an option group but are independent command
buttons, just put lines 3 & 4 on the coding for button 1, and lines 6 & 7 on
button 2). The first line (saving the record) is a hard lessonm to learn -
there are a number of circumstances where Access doesn't always respond to
the last changed item unless you force it.

Hope this helps!
Signature

Laury Burr a.k.a. Doogle

> I have a form that has 2 embedded subforms on it.  I also have 2 toggle
> buttons on the form.
[quoted text clipped - 3 lines]
> would remain hidden.  However, if Toggle2 is clicked, then subform1 would
> remain hidden and subform2 would display.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.