473,508 Members | 2,326 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 1950
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,557 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
5262
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,...
1
2974
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...
2
2986
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...
0
2225
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...
3
3833
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,...
12
1977
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
3065
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...
2
1995
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...
4
6019
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...
162
10065
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...
0
7224
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,...
0
7323
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,...
1
7038
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...
0
7493
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5625
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,...
1
5049
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3192
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
763
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
415
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...

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.