conditionalTextbox visibility

D

Dave Smith

Hi all, i would like to have a text box that is visible depending on a
checkbox value. i have tried my best with the conditional formatting, & i
managed to get some code to work on the _afterupdate event but it would only
change after the first update. anyhow i'm probably frustrating you by
dribbling....
i want the text box to be visible when checkbox=Yes & invisible when =No
thankyou

Dave Smith
 
N

Nikos Yannacopoulos

Dave,

Assuming the textbox and checkbox are named Text1 and Check1
respectively, you need to put the following code in the checkbox's After
Updade (or On Change) event:

Me.Text1.Visible = Me.Check1

Moreover, if the checkbox is bound to a table field, you should also put
the same code in the form's On Current event, so the textbox is made
visible / invisile depending on the value of the checkbox when you first
open the form, and as you scroll through records.

HTH,
Nikos
 
D

Dave Smith

that got it thankyou

Dave

Nikos Yannacopoulos said:
Dave,

Assuming the textbox and checkbox are named Text1 and Check1
respectively, you need to put the following code in the checkbox's After
Updade (or On Change) event:

Me.Text1.Visible = Me.Check1

Moreover, if the checkbox is bound to a table field, you should also put
the same code in the form's On Current event, so the textbox is made
visible / invisile depending on the value of the checkbox when you first
open the form, and as you scroll through records.

HTH,
Nikos
 
Top