Hidding #Error on form cell

R

Rich

I have a form that displays the results of a date add

=Format(DateAdd("d",[days_till_close],[date_refer_close]),"dddd"",
""mmm d yyyy")

However if the date_refer_close is not populated it of course returns
#error. How can I hide value? I would like to lock this text box and
show a blank if the value is #error.
 
M

Marshall Barton

Rich said:
I have a form that displays the results of a date add

=Format(DateAdd("d",[days_till_close],[date_refer_close]),"dddd"",
""mmm d yyyy")

However if the date_refer_close is not populated it of course returns
#error. How can I hide value? I would like to lock this text box and
show a blank if the value is #error.


How about not generating the error if the field is null?

=IIf([date_refer_close] Is Null, "", Format( . . . ))

Since the text box's control source is an expression, it
will not be editable, so locking it is unnecessary.
 

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

saveas macro help 1
Date & Time 2
grouping issue with ' is not null ' 1
Format of date in my code 3
Date & time 2
Coding Date Question 2
Sorted and Unique Date Period 2
Need help with an IF Function 4

Top