[AccessD] Nz and Val

Gustav Brock gustav at cactus.dk
Fri Jun 3 12:08:01 CDT 2011


Hi Tony

Let Nz return a numeric:

If Me!InvoiceAmount + Nz(Me!TotalInvoice, 0) > Nz(Me!Budget, 0) Then
 ..... display Yes/No message
End If

/gustav


>>> iggy at nanaimo.ark.com 03-06-2011 18:23 >>>
Hey All
I have four controls on a form.
JobCode - a combo box
Budget -an unbound text box control source = 
format(me!JobCode.column(2),"#.###")
TotalInvoices - an unbound text box control source = 
format(me!JobCode.column(4),"#.###.00")
InvoiceAmount - a bound text box
What I am doing (On BeforeUpdate) is letting the user know if the 
current invoice amount + the total invoice amount may exceed the budget.
Just curious, can someone explain to me why this doesn't work
me!InvoiceAmount=$200
me!TotalInvoice=$800
me!Budget=$900
If me!InvoiceAmount + nz(me!TotalInvoice)> nz(me!Budget) then
 ..... display Yes/No message
endif
When I check, the values come out to 200>900
But this does work
If me!InvoiceAmount + val(nz(me!JobCode.column(4))> nz(me!Budget) then
 ..... display Yes/No message
endif
When I check, the values come out to1000>900





More information about the AccessD mailing list