text box value

  • Thread starter Thread starter Giorgos Louloudis via AccessMonster.com
  • Start date Start date
G

Giorgos Louloudis via AccessMonster.com

Hello there!!
I have a text box at which i want to place a percentage (expression
calculated from other text boxes). But there are some cases where the
division i want to do is with zero.In that case i want just to place the
value 0 in the text box and in all other cases the expression. I try to use
the function IIf but i always make a syntax error.i read the help and i do
whatever it is described there.Anyone can help me with this?
Thanks in advace!!
 
Giorgos Louloudis via AccessMonster.com said:
Hello there!!
I have a text box at which i want to place a percentage (expression
calculated from other text boxes). But there are some cases where the
division i want to do is with zero.In that case i want just to place the
value 0 in the text box and in all other cases the expression. I try to
use
the function IIf but i always make a syntax error.i read the help and i do
whatever it is described there.Anyone can help me with this?
Thanks in advace!!

=IIf([expression]=0, 0, [expression])

Tom Lake
 
place the following type of code in the afterupdate event both of the
fields used in the calculation:


if not isnull(me.divisor) and not me.diviser = 0 and not
isnull(me.intonumber) then
me.answer = me.intonumber / me.divisor
else
me.answer = 0
end if

If you have already restricted the values of the numbers so that null
is not possible then the two isnull tests do not need to be in the
division.
 
it was needed to place ; instead of , that is described in the help of access.

Thanks very much for your time!!

Tom said:
Hello there!!
I have a text box at which i want to place a percentage (expression
[quoted text clipped - 5 lines]
whatever it is described there.Anyone can help me with this?
Thanks in advace!!

=IIf([expression]=0, 0, [expression])

Tom Lake
 
Back
Top