Hidding #Error on form cell

  • Thread starter Thread starter Rich
  • Start date Start date
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.
 
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

Date & Time 2
Date & time 2
Syntax Error 4
automation error 0
Excel How to change the "Short Date" format in Excel? 4
Invalid use of Null error 2
Format of date in my code 3
Coding Date Question 1

Back
Top