Make formula based on other formula blank

G

Guest

Is there a way to make a value in a text box, that is based on another text
box, blank and not always say "#error" ? I tried using an IIF statement but
it didn't work. I'm sure people run into these all the time. Thanks

txtbox1:

txtbox2:=DateSerial(year[txtbox1]....

When opening form... txtbox2 displays..."#error"
 
A

Allen Browne

DateSerial must have numbers, not nulls, so try something like this:

=IIf(IsNumeric([txtbox1]) And IsNumeric([txtbox2]) And
IsNumeric([txtbox3])), DateSerial([txtbox1], [txtbox2], [txtbox3], Null)
 
G

Guest

Once again it works great!

Allen Browne said:
DateSerial must have numbers, not nulls, so try something like this:

=IIf(IsNumeric([txtbox1]) And IsNumeric([txtbox2]) And
IsNumeric([txtbox3])), DateSerial([txtbox1], [txtbox2], [txtbox3], Null)

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

Reply to group, rather than allenbrowne at mvps dot org.

Kou Vang said:
Is there a way to make a value in a text box, that is based on another
text
box, blank and not always say "#error" ? I tried using an IIF statement
but
it didn't work. I'm sure people run into these all the time. Thanks

txtbox1:

txtbox2:=DateSerial(year[txtbox1]....

When opening form... txtbox2 displays..."#error"
 

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