I am receiving invalid use of null for my vba code
Me.B3 = IIf(Nz([B1], 0) = 0 Or Nz([B2], 0) = 0, Null, CLng(((([txtAmount] * 43) / [B1]) / [B2]) - (Nz([A4], 0) + Nz([A5], 0))))
Hi. If it's not one thing, it's another, isn't it. How about trying this out?i am receiving division by zero Me.B3 = Nz([txtAmount] * 43560) / Nz([B1]) / Nz([B2]) - Nz([A4]) + Nz([A5]).
Me.B3 = Nz([txtAmount]) * 43560 / IIf(Nz([B1],0)=0,1,Nz([B1])) / IIf(Nz([B2],0)=0,1,Nz([B2])) - Nz([A4]) + Nz([A5])
Me.B3 = IIf(Nz([B1],0)=0 OR Nz([B2],0)=0,Nz([txtAmount]) * 43560 / IIf(Nz([B1],0)=0,1,Nz([B1])) / IIf(Nz([B2],0)=0,1,Nz([B2])) - Nz([A4]) + Nz([A5]))
Hi. How about breaking it down, so you can see where the problem is. For example, start out with this:I am receiving Division By Zero
IIf(Nz([B1],0)=0,0,Nz(Me.txtAmount,0)*43560/IIf(Nz([B1,0)=0,1,Nz([B1],0)))
Okay, like I was saying earlier, you slowly build your expression, making sure each piece works before moving on. So, for example, if the above shorter expression works without errors, you then try to add the [B2] piece to it and fix any errors before adding [A4] and then [A5].That code works perfectly in the control. I have several columns 1,2,3,4,5,6,7. The primary column you enter values are 4 and 5. Let's you enter all the values and realized I enter the wrong number in one of the textboxes in column 4, and edit the value to the column. The figures below that row needs to update. The original code did work, but it already had values in textbox. When i cleared my entry by pressing backspace to reset to 0, then invalid use of null, and now today it is showing Division by Zero.
Does anyone have Skype to screen share? I would like for someone to help me with fixing. I am welling to pay.
I could try to help you via Skype. What is your time zone?
That's perfect! I'm available now. You can search for me in Skype (try theDBguy).Thank you so much, I am west cost time![]()