#div/0! error...doesnt make sense..

Durien512

Registered User.
Local time
Today, 13:18
Joined
Dec 14, 2005
Messages
61
I am trying to track down why i get a #div/0 error...

i have a form that is a sales invoice. It also has a subform with in where the items being sold are entered.

in the subform i have on the footer a Sum([Selling price])
so that i have a total in the subform..

then i pull that total into the mainform using =[subform2].Form![TOTAL]

it all works great.... but if some one buys multiple items and one price is left at 0.... i get that div/0 displayed on my totals..??

see the attached image for a visual of what i am talking about...

attachment.php
 

Attachments

  • Untitled-2.jpg
    Untitled-2.jpg
    81 KB · Views: 219
here is another image showing the div/0
 

Attachments

  • Untitled-2.jpg
    Untitled-2.jpg
    84.2 KB · Views: 137
you most add a nz([Price]) the first time you multiply [items]*[Price] and that should help. try to use the Nz function as much as possible.

sam
 
You may have to do something like:

=Sum([subform2].Form![Selling price]

???
 
using the nz() gets rid of the div/0 but it displays error...

everything works fine.. but i cant leave any prices at '0'... which i want to be able to do...
 
I think your problem is that the main form logic is fired off first then the sub form logic. There are several ways to fix this, one being the sample code I posted above. The other is to place a requery somewhere in the subform that re-calculates the main form 'Total' control...
 

Users who are viewing this thread

Back
Top Bottom