Full Version: Hide "#div/0!" Error In A Textbox
UtterAccess Forums > Microsoft® Access > Access Forms
InfoHound
I have a form where until a value is entered into a text box other textboxes that are dependent on it display "#Div/0".
Is it possible to have the text boxes remain blank until a value is entered into the text box they are dependent on?

Example: This is what I'm using now.

txtRecMoney Control source is unbound

txtCal1 control source is "= iif(IsError(txtRecMoney/2)," ",(txtRecMoney/2))"

What I'm trying to do is : if there is any kind of error leave txtCal1 blank and if there is no error(s) then show the result of "txtRecMoney/2".

Thank you
dmhzx
How about

"= iif(isnull(txtRecMoney)," ",(txtRecMoney/2))"

Though I don't see why you're getting a divide by zero error.

Is txtRecMoney manually entered as a value?
InfoHound
Yep that did it!

Thank you very much.
dmhzx
Pleased to help.
The thing to remember about iif is that it performs ALL the expressions before deciding what to do, so whereas it knows that the first part is an error, it cannot work out the last part --err---because it's an error.

Hope it goes smoothly from here. yw.gif
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.