dbTalk Databases Forums  

#Num! displayed in a control ( in a textbox of a subform)

comp.databases.ms-access comp.databases.ms-access


Discuss #Num! displayed in a control ( in a textbox of a subform) in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
zufie
 
Posts: n/a

Default #Num! displayed in a control ( in a textbox of a subform) - 03-31-2009 , 01:05 PM






I see #Num! displayed in a control ( in a textbox of a subform).

What can I do to avoid this error?

Do I need to add =IIf([Total Complete week journal]=0,0, to the
beginning of the equation in my control source (of my textbox)?

-OR-

Do I need to delete *100 from my equation? (wich follows below)

=IIf([Total Complete week journal]=0,0,[Total Average Calcium]/[Total
Complete week journal])*100

I've tried both fixes before and each worked on its own or was I just
a lucky newbie Access programmer?

Your suggestions would be greatly appreciated!

Thanks,

John

Reply With Quote
  #2  
Old   
Salad
 
Posts: n/a

Default Re: #Num! displayed in a control ( in a textbox of a subform) - 03-31-2009 , 02:37 PM






zufie wrote:
Quote:
I see #Num! displayed in a control ( in a textbox of a subform).

What can I do to avoid this error?

Do I need to add =IIf([Total Complete week journal]=0,0, to the
beginning of the equation in my control source (of my textbox)?

-OR-

Do I need to delete *100 from my equation? (wich follows below)

=IIf([Total Complete week journal]=0,0,[Total Average Calcium]/[Total
Complete week journal])*100

I've tried both fixes before and each worked on its own or was I just
a lucky newbie Access programmer?

Your suggestions would be greatly appreciated!

Thanks,

John
Here's one link I found
http://groups.google.com/group/comp....b4c51868a4956c


Reply With Quote
  #3  
Old   
banem2@gmail.com
 
Posts: n/a

Default Re: #Num! displayed in a control ( in a textbox of a subform) - 04-01-2009 , 02:22 PM



On Mar 31, 8:05*pm, zufie <john.marru... (AT) illinois (DOT) gov> wrote:
Quote:
I see #Num! displayed in a control ( in a textbox of a subform).

What can I do to avoid this error?

Do I need to add =IIf([Total Complete week journal]=0,0, to the
beginning of the equation in my control source (of my textbox)?

-OR-

Do I need to delete *100 from my equation? (wich follows below)

=IIf([Total Complete week journal]=0,0,[Total Average Calcium]/[Total
Complete week journal])*100

I've tried both fixes before and each worked on its own or was I just
a lucky newbie Access programmer?

Your suggestions would be greatly appreciated!

Thanks,

John
Hi,

Make sure that controls on the subform are named as [Total Complete
week journal] and [Total Average Calcium], check if they are numbers
and [Total Average Calcium] <> 0. If they are string type, try with:

=NZ(CDbl([Total Average Calcium]), 0)/NZ(CDbl([Total Complete week
journal]), 0)*100

To avoid display of error (dividing with 0 or 0 divided with
something), you can add IIf() to check if both fields are <> 0 and
only then run above. If the numbers are Long Integer type replace CDbl
with CLng, if they are Integer type replace CDbl with CInt.

Regards,
Branislav Mihaljev
Microsoft Access MVP


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.