#Number Error

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have 3 unbound text boxes, I am trying to divide and get the percentage of
2 and display the result in the 3 one, however if the text boxes contain 0
then the error #number shows on the 3 text box how do I get rid of this? I
know its logic that 0/0 =0 but how do I display that instead of the error

This is what I have as the fomula
=[text1]/([text1]+[text2])*100

e.g., 1/(1+2)*100 =33.33%
0/(0+0)*100 =#number
 
Hi.
how do I get rid of this?

Try this (it's all one line):

=IIf((NZ([text1],0)+NZ([text2],0))<>0,NZ([text1],0)/(NZ([text1],0)+NZ([text2],0))*100,Null)


HTH.

Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address, so that a message
will be forwarded to me.)
Beware to those who use munged addresses: known newsgroup E-mail harvesters
for spammers are (e-mail address removed) and (e-mail address removed)

- - -
When you see correct answers to your question posted in Microsoft's Online
Community, please sign in to the Community and mark these posts as "Answers,"
so that all may benefit by filtering on "Answered questions" and quickly
finding the right answers to similar questions. Remember that questions
answered the quickest are often from those who have a history of rewarding
the contributors who have taken the time to answer questions correctly.


JOM said:
I have 3 unbound text boxes, I am trying to divide and get the percentage of
2 and display the result in the 3 one, however if the text boxes contain 0
then the error #number shows on the 3 text box how do I get rid of this? I
know its logic that 0/0 =0 but how do I display that instead of the error

This is what I have as the fomula
=[text1]/([text1]+[text2])*100

e.g., 1/(1+2)*100 =33.33%
0/(0+0)*100 =#number
 
Thanks alot, that worked perfect
oJ!

'69 Camaro said:
Hi.
how do I get rid of this?

Try this (it's all one line):

=IIf((NZ([text1],0)+NZ([text2],0))<>0,NZ([text1],0)/(NZ([text1],0)+NZ([text2],0))*100,Null)


HTH.

Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address, so that a message
will be forwarded to me.)
Beware to those who use munged addresses: known newsgroup E-mail harvesters
for spammers are (e-mail address removed) and (e-mail address removed)

- - -
When you see correct answers to your question posted in Microsoft's Online
Community, please sign in to the Community and mark these posts as "Answers,"
so that all may benefit by filtering on "Answered questions" and quickly
finding the right answers to similar questions. Remember that questions
answered the quickest are often from those who have a history of rewarding
the contributors who have taken the time to answer questions correctly.


JOM said:
I have 3 unbound text boxes, I am trying to divide and get the percentage of
2 and display the result in the 3 one, however if the text boxes contain 0
then the error #number shows on the 3 text box how do I get rid of this? I
know its logic that 0/0 =0 but how do I display that instead of the error

This is what I have as the fomula
=[text1]/([text1]+[text2])*100

e.g., 1/(1+2)*100 =33.33%
0/(0+0)*100 =#number
 
You're welcome! Glad it helped you.

Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address, so that a message
will be forwarded to me.)
Beware to those who use munged addresses: known newsgroup E-mail harvesters
for spammers are (e-mail address removed) and (e-mail address removed)


JOM said:
Thanks alot, that worked perfect
oJ!

'69 Camaro said:
Hi.
how do I get rid of this?

Try this (it's all one line):

=IIf((NZ([text1],0)+NZ([text2],0))<>0,NZ([text1],0)/(NZ([text1],0)+NZ([text2],0))*100,Null)


HTH.

Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address, so that a message
will be forwarded to me.)
Beware to those who use munged addresses: known newsgroup E-mail
harvesters
for spammers are (e-mail address removed) and (e-mail address removed)

- - -
When you see correct answers to your question posted in Microsoft's
Online
Community, please sign in to the Community and mark these posts as
"Answers,"
so that all may benefit by filtering on "Answered questions" and quickly
finding the right answers to similar questions. Remember that questions
answered the quickest are often from those who have a history of
rewarding
the contributors who have taken the time to answer questions correctly.


JOM said:
I have 3 unbound text boxes, I am trying to divide and get the
percentage of
2 and display the result in the 3 one, however if the text boxes
contain 0
then the error #number shows on the 3 text box how do I get rid of
this? I
know its logic that 0/0 =0 but how do I display that instead of the
error

This is what I have as the fomula
=[text1]/([text1]+[text2])*100

e.g., 1/(1+2)*100 =33.33%
0/(0+0)*100 =#number
 

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

Back
Top