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 / April 2007

Tip: Looking for answers? Try searching our database.

Hide Field based on Another

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ty Archer - 30 Apr 2007 16:32 GMT
Hi,

I have a field call "Status". The content can be "Active" or "Non-Active".
If it is set to Non-Active, I want another field call "Reason" to be
displayed so the user can put an answer in that field, otherwise "Reason" is
not displayed. How can I do this in my form? Thanks very much.
Ofer Cohen - 30 Apr 2007 17:26 GMT
You can use the code

Me.[Reason].Visible = (me.[Status] = "Non-Active")

If the criteria will return True, it will make the other field visible

Enter this code in two places
1. OnCurrent event of the form
2. AfterUpdate event of the field Status
Ty Archer - 30 Apr 2007 19:10 GMT
Hey, it works great. Thanks very much.
-Ty-

> You can use the code
>
[quoted text clipped - 5 lines]
> 1. OnCurrent event of the form
> 2. AfterUpdate event of the field Status
John W. Vinson - 30 Apr 2007 17:31 GMT
>Hi,
>
>I have a field call "Status". The content can be "Active" or "Non-Active".
>If it is set to Non-Active, I want another field call "Reason" to be
>displayed so the user can put an answer in that field, otherwise "Reason" is
>not displayed. How can I do this in my form? Thanks very much.

You can do this with one line of VBA code - but you need it twice. In both the
form's Current event and the Status control's AfterUpdate event, click the ...
icon; choose Code Builder; and add this between the Sub and End Sub lines that
Access gives you:

Me.Reason.Visible = (Me.Status = "Non-Active")

            John W. Vinson [MVP]
 
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.