Yes/No Box Ticked Conditionally

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

Guest

Hi all,

I have a form that contains a Yes/No box labelled 'Completed'. Initially
this box is uncheck. However, a second box labbelled 'Date' will at some
point in the future will have a date entered, at start of database the 'Date'
box is empty (null). I would like to automate a tick to appear in the Yes/No
box only when a date has been entered into the date box. Hope I have
explained this clear enough. Thanks everyone for firstly taking the time to
read this. Any and all help welcome. If I am not too far out I've been
looking into the iif statement?????

Thanks

Debbie D (UK)
 
Debbie said:
Hi all,

I have a form that contains a Yes/No box labelled 'Completed'.
Initially this box is uncheck. However, a second box labbelled
'Date' will at some point in the future will have a date entered, at
start of database the 'Date' box is empty (null). I would like to
automate a tick to appear in the Yes/No box only when a date has been
entered into the date box. Hope I have explained this clear enough.
Thanks everyone for firstly taking the time to read this. Any and
all help welcome. If I am not too far out I've been looking into the
iif statement?????

Thanks

Debbie D (UK)

First off, if you have a field in your table for this Yes/No you should get
rid of it as it is redundant data. The presence or absence of a value in
your date field provides the same information. If you want to *display* a
CheckBox on your forms and reports just bind it to the expression...

=Nz([DateField], 0)

This will work because a CheckBox will treat any non-zero (and non-null)
value as True.
 
Rick,

Thanks very much for your quick reply. Took note of the table explanation
and delete the field from there. However, under the choose builder and then
expression buider I entered your code modified for the field name of the
date box to read:

=Nz([Text91], 0)

When I enter a date into Text91 the tick box does not change. Any
suggestions? Thanks again.

Debbie D.

Rick Brandt said:
Debbie said:
Hi all,

I have a form that contains a Yes/No box labelled 'Completed'.
Initially this box is uncheck. However, a second box labbelled
'Date' will at some point in the future will have a date entered, at
start of database the 'Date' box is empty (null). I would like to
automate a tick to appear in the Yes/No box only when a date has been
entered into the date box. Hope I have explained this clear enough.
Thanks everyone for firstly taking the time to read this. Any and
all help welcome. If I am not too far out I've been looking into the
iif statement?????

Thanks

Debbie D (UK)

First off, if you have a field in your table for this Yes/No you should get
rid of it as it is redundant data. The presence or absence of a value in
your date field provides the same information. If you want to *display* a
CheckBox on your forms and reports just bind it to the expression...

=Nz([DateField], 0)

This will work because a CheckBox will treat any non-zero (and non-null)
value as True.
 
Debbie said:
Rick,

Thanks very much for your quick reply. Took note of the table
explanation and delete the field from there. However, under the
choose builder and then expression buider I entered your code
modified for the field name of the date box to read:

=Nz([Text91], 0)

When I enter a date into Text91 the tick box does not change. Any
suggestions? Thanks again.

Did you tab out of TextBox? In my testing the CheckBox did not respond
until I had tabbed out because the update doesn't occur until you do that.
 

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

Similar Threads


Back
Top