473,789 Members | 2,617 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Hiding Subforms in Access

26 New Member
I have a form which tracks Change Requests. Sometimes documentation needs to be updated as a result of the change. So, instead of bogging down the form with mulitple comment fields, I have created a subform to input any affected documents. Is there a way to hide the subform (as the form is already quite messy and large) if no documents are affected? I was thinking if the user ticks a checkbox indicating documents are affected, the subform would show. Any help would be awesome.

Thanks!

PotatoChip
(no dip)
Apr 24 '08 #1
4 1975
Megalog
378 Recognized Expert Contributor
Sure can! I do this all the time.. this is exactly how:

Put in that checkbox, we'll call it chkChange here.
Bind it to a new Yes/No field in the parent form's table.
Set the subform visible property to 'False' when your parent form Loads, or in Design view.
Then, in the Click event for the checkbox, AND the OnCurrent event for the parent form, you would do the following:

Expand|Select|Wrap|Line Numbers
  1. Call ChangeDocSubformToggle
which will call upon the following code:

Expand|Select|Wrap|Line Numbers
  1. Private Sub ChangeDocSubformToggle
  2.  
  3. If Me.chkChange.Value = True Then
  4.     Me.ChangeDocument_Subform.Visible = True
  5.     Me.ChangeDocument_Subform.Requery 'This line might not be needed, I use it because Access 2007 gets buggy without it on my forms.
  6.  
  7. Else
  8.     Me.ChangeDocument_Subform.Visible = False
  9.     Me.Refresh  'This line might not be needed, I use it because Access 2007 gets buggy without it on my forms.
  10. End If
  11.  
  12. End Sub
Apr 24 '08 #2
PotatoChip
26 New Member
Thanks! At first it didn't work but then I played with it and taking out the Toggle bits seemed to do the trick! Lol...people at work think I'm some computer genius...little do they know...muhahaha !
Apr 24 '08 #3
Megalog
378 Recognized Expert Contributor
Your secret is safe with us!
Glad you got it to work, btw.
Apr 24 '08 #4
NeoPa
32,579 Recognized Expert Moderator MVP
How about :
Expand|Select|Wrap|Line Numbers
  1. Me.ChangeDocument_Subform.Visible = Me.chkChange
Apr 25 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

7
5283
by: Caroline Bradford | last post by:
Hi there, I wonder if there is a kind and knowledgeable person out there who can help me with a sticky problem. I have a form with a subform which shows detailed data. For complicated reasons, which I won't go into, the detail which I require cannot be determined programmatically, so I planned to have two subforms, identical in design but with slightly different data, dependent on a criterion in the main form. Both will sit on the...
1
2995
by: M Wells | last post by:
Hi All, I am developing an Access 2003 project application with the back end in SQL Server 2003. I have a master form that tracks projects, and several subforms on it that track various aspects of the project. On the masterform I have two unbound listboxes that I populate with information regarding the current record in one of the subforms.
2
3004
by: Jack | last post by:
Hi all, I searched the archives and found everyone happy with Stephen's MouseWheel On/Off code except for those with subforms. Stephen's page indicates that he has added code to handle subforms ("Bug Fix for SubForms with ScrollBars. Bug fix for SubForms without visible ScrollBars.") - BUT I still can't get it to work on my app with my subforms. I'm using Access 2000, It works fine on the main forms but not on the
0
2244
by: Jack | last post by:
Gday everyone, I'm dearly hoping Stephen Lebans is going to update his masterpeice to stop the mouse wheel scrolling to work on subforms *he has indicated this to me but of course beggers can't be choosers here so I have no idea when this would be done*. I'm just wondering if anyone has gotten around the problem some other way? --Original Thread---
3
3847
by: Diana Gard | last post by:
Perhaps this is a design flaw, please let me know. I'm using Access 2000. I have a form with a tab control and 5 subforms within those tabs. The forms match with the tables: Client main, Intake, Financial, Fees, Payments, Bills, Bill Line Items. The design works thusly - Client Main relates to Intake. Intake relates to financial. Financial relates Fees, Payments and Bills. Bills relates to Bill Line Items. On the form, I use the...
12
2021
by: Paul T. RONG | last post by:
Is it possible to divide a tall subform with 80 records to two subforms each with 40 records? Dear All, What I have: Tables: tblProduct, tblOrder, tblOrderDetail
8
3092
by: Zlatko Matić | last post by:
Hello. How can I synchronize subforms content with current record in master form, if both form and subform are based on DAO code ? I assigned DAO recordset to forms by using QueryDef, on Load event. Thanks...
2
2022
by: collegekid | last post by:
Hi everyone, basically my problem is this: I am using an Access 2000 format. And--I have four subforms in my main form. (Purpose of this is to track projects.) So in my main form I enter the project name, one primary point person for it (1:N list from a separate table), other details, and a manually entered tracking number, which is the primary key. Now, I also need to put down the legal entities, business managers, financial...
4
6058
by: Harlequin | last post by:
I have a question concerning the need to trigger events within a "child" subform which is itself enbedded within a master "parent" form and which is accessible via a tab in the parent form. Becuase this is all very difficult to explain in words, please bear with me as I endevour to explain what it is I am trying to do. It would be helpful if I could attach a graphics file to this posting that would help explain what it is I'm trying to achieve...
162
10303
by: Sh4wn | last post by:
Hi, first, python is one of my fav languages, and i'll definitely keep developing with it. But, there's 1 one thing what I -really- miss: data hiding. I know member vars are private when you prefix them with 2 underscores, but I hate prefixing my vars, I'd rather add a keyword before it. Python advertises himself as a full OOP language, but why does it miss one of the basic principles of OOP? Will it ever be added to python?
0
9666
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10408
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10199
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10139
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9020
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5551
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4092
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3700
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2909
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.