Check box control for textbox

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to have a text box display the current date if and only if a separate checkbox is checked.
Is the check considered "yes" or "true"
Should this be done using the 'On Click' box
If so, what event or code could be used to display =Date( )
Any insight is appreciated

Chad Thompson
 
Try setting the Control Source of the text box to:
=IIf([MyCheckBox], Date(), Null)
replacing "myCheckBox" with the name of your box.
 
Allen,

If I were to use the formula, iif(exp,true, false) in the Check box's Control Source, is there a way to enter info into the text box if the expression is false? I would want to put info in the text box if the check box is not clicked? How would this be done?
 
If the check box is bound to an expression, you cannot change the check box.
However, you can type anything into the text box (assuming it is not also
bound to an expresion).

Perhaps you are asking, Can I prevent the user entering something in the
text box if the check box is not checked? You could do that by creating a
Validation Rule on your table (in the Properties box in table design view)
where:
(MyYesNoField = TRUE) OR (MyTextField Is Null)

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.
Brian said:
Allen,

If I were to use the formula, iif(exp,true, false) in the Check box's
Control Source, is there a way to enter info into the text box if the
expression is false? I would want to put info in the text box if the check
box is not clicked? How would this be done?
 
Back
Top