Go Back   Access World Forums > Microsoft Access Discussion > Forms

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 05-17-2018, 04:07 AM   #1
Gismo
Newly Registered User
 
Join Date: Jun 2017
Posts: 180
Thanks: 90
Thanked 0 Times in 0 Posts
Gismo is on a distinguished road
Hide control if Subform

Hi,

Please assist with the correct code.
I want to hide a control in a sub form if a value in another sub form is met.

If Me.Form![Sanction]![AH Sanctioned] = False Then
Me.AHGApproval.Visible = True
Else
Me.AHGApproval.Visible = False
End If

End Sub

Gismo is offline   Reply With Quote
Old 05-17-2018, 04:27 AM   #2
Minty
AWF VIP
 
Minty's Avatar
 
Join Date: Jul 2013
Location: UK - Wiltshire
Posts: 5,184
Thanks: 123
Thanked 1,416 Times in 1,388 Posts
Minty has a spectacular aura about Minty has a spectacular aura about Minty has a spectacular aura about
Re: Hide control if Subform

Where is the other control? in the same parent form or another form all together?

This syntax is incorrect Me.Form![Sanction]![AH Sanctioned]

Bookmark this page and refer to it for the rest of your Access life
http://access.mvps.org/access/forms/frm0031.htm
__________________
If we have helped;
Please click the 'reputation' scales symbol on the left, tick 'I approve' and leave a comment.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Minty is offline   Reply With Quote
Old 05-17-2018, 05:05 AM   #3
Gismo
Newly Registered User
 
Join Date: Jun 2017
Posts: 180
Thanks: 90
Thanked 0 Times in 0 Posts
Gismo is on a distinguished road
Re: Hide control if Subform

AH Sanctioned is a control in the subform Sanction
AHGApproval is a control in the current subform

both sub forms are in the form EditSP

Gismo is offline   Reply With Quote
Old 05-17-2018, 05:18 AM   #4
Minty
AWF VIP
 
Minty's Avatar
 
Join Date: Jul 2013
Location: UK - Wiltshire
Posts: 5,184
Thanks: 123
Thanked 1,416 Times in 1,388 Posts
Minty has a spectacular aura about Minty has a spectacular aura about Minty has a spectacular aura about
Re: Hide control if Subform

Okay using the link provided that would work out something like ;

Code:
Me.AHGApproval.Visible =  Not Forms!EditSP!Sanction.Form![AH Sanctioned]
This assumes that the sub form control for form Sanction is called Sanction

Note that this is the control that contains the subform, NOT the subform name.

__________________
If we have helped;
Please click the 'reputation' scales symbol on the left, tick 'I approve' and leave a comment.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Minty is offline   Reply With Quote
The Following User Says Thank You to Minty For This Useful Post:
Gismo (05-18-2018)
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Hide Control Gismo Forms 17 05-08-2018 05:57 AM
Hide Control If Gismo Modules & VBA 1 08-02-2017 01:42 AM
Change Mian Form control by subform control and Massage if Subform Record empty Falcon88 Forms 0 02-18-2015 08:05 AM
Hide a tab control page? pablavo Modules & VBA 1 01-23-2008 07:26 AM
Hide a control based on another control value skelley Forms 1 08-15-2000 05:14 PM




All times are GMT -8. The time now is 04:22 PM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Sponsored Links

How to advertise

Media Kit


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World