Check box control for textbox

C

Chad Thompson

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
 
A

Allen Browne

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

Brian

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?
 
A

Allen Browne

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top