Text Box

S

SG

I have a texy box with the following control source
=IIf(IsNull([SubTotal]),Null,CCur(Round([SubTotal]/(VAT.Column(1))))) which
works fine but if there is nothing in the field I get the following #Num!
how can I stop this?

Thanks in advance.


S
 
D

Damian S

Hi SG,

Nothing in which field? And do you have any formatting switched on?

Damian.
 
S

SG

Sorry Damian,

I should give more details I have an invoice form and then an invoice sub
form when I select the VAT drop down either 1.175% or 0% I then select the
item to be sold in the invoice sub form this then calculates the amount less
vat, vat total and total excluding VAT all works fine until and select the 0
rate VAT then I get a #Num! in the Sub Total Excl VAT Text box and #Error in
the VAT Text box. All is ok when I select the 1.75 from the VAT drop down.


Damian S said:
Hi SG,

Nothing in which field? And do you have any formatting switched on?

Damian.

SG said:
I have a texy box with the following control source
=IIf(IsNull([SubTotal]),Null,CCur(Round([SubTotal]/(VAT.Column(1)))))
which
works fine but if there is nothing in the field I get the following #Num!
how can I stop this?

Thanks in advance.


S
 
N

Naeem Azizian

you are checking the 'part' to be zero or not, if the part is zero in a
fraction, result is zero, you need to check the denominator not to be
zero, then you wont get an error message.
0/1 = 0
1/0 = Error

Damian said:
If you are selecting zero, you are attempting to divide by zero... this will
cause an error...

Damian.

SG said:
Sorry Damian,

I should give more details I have an invoice form and then an invoice sub
form when I select the VAT drop down either 1.175% or 0% I then select the
item to be sold in the invoice sub form this then calculates the amount less
vat, vat total and total excluding VAT all works fine until and select the 0
rate VAT then I get a #Num! in the Sub Total Excl VAT Text box and #Error in
the VAT Text box. All is ok when I select the 1.75 from the VAT drop down.


Damian S said:
Hi SG,

Nothing in which field? And do you have any formatting switched on?

Damian.

:

I have a texy box with the following control source
=IIf(IsNull([SubTotal]),Null,CCur(Round([SubTotal]/(VAT.Column(1)))))
which
works fine but if there is nothing in the field I get the following #Num!
how can I stop this?

Thanks in advance.


S
 
Top