Tick box to enable other fields

stu_c

Registered User.
Local time
Today, 15:39
Joined
Sep 20, 2007
Messages
494
Hi all
I have got tick box that I want when ticked to unhide some fields is this possible?

The Tick box is called: Dispose and when this is ticked I want the field Disposel address etc. to be unhidden?

thanks
 
Use the After Update event of your tick box to change the Visible property of your disposal related controls in your form.
 
Any chance if some coding?
 
In the forms On Current event -

Code:
Me.Disposel_address.Visible = False
*list any more fields that should be hidden when the form opens here*

In the After Update event of Dispose -

Code:
If Me.Dispose = -1 Then
Me.Diposel_address.Visible = True
*list any more fields to be unhidden here*
End If
 
stu_c,

Just one observation, and this is a personal preference, but I think it helps your users when you use the "Enabled" property rather than the visible property of controls when controling when they can make a data entry. My reasoning for this is that if controls are not enabled (visible but just greyed out) it becomes evident to the user that there are field where data entry is to be made and then they also realize that they need to click the check box to enable these controls. I realize that this is not relative to the question you asked, but I just thought I would throw it out there anyway.

Not, to expand on whay Neil has said;

Use the following code in the After Update event of your check box:
Code:
me.NameOfControl.Visible = Me.NameOfCheckbox

Use a line of code like this for each control that you wish to be not visible when the check box is not checked and visible when the the check box is checked.

You can simply change the "Visible" to "Enabled" if you want to have your controls visible but not enabled when the check box is not checked and enabled when the check box is checked. If you decide to use this method, you will want to set the Visible property of each control to true and the Enabled property to false in design mode and save your changes to your form.
 
Last edited:
Just wanted to mention that this will only work in an ordinary form layout - if you conditionally show/hide/enable/disable fields in a continuous or datasheet form, the whole column will be affected by whatever the current record is doing.
 

Users who are viewing this thread

Back
Top Bottom