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]