DLookUp with Nz Function

G

Guest

I'm had a DLookUp working on a report, but also need it to return a value of
zero if there is no info to return. Here is the code that worked before I
put the Nz( ) in.
[InvQty] is a number. Everything else is text. Pls help....

=Nz(DLookUp("[InvQty]","[PurchA]","[InventoryPN]= [PN] And
[InventoryLocation]= 'F Stor' "))
 
G

Guest

The NZ function will return any value that you want incase of a null, but you
have to specify what value you want it to return

That what you have
=Nz(DLookUp("[InvQty]","[PurchA]","[InventoryPN]= [PN] And
[InventoryLocation]= 'F Stor'"))

To return 0, change it to
=Nz(DLookUp("[InvQty]","[PurchA]","[InventoryPN]= [PN] And
[InventoryLocation]= 'F Stor'"),0)

To return a string saying no value
=Nz(DLookUp("[InvQty]","[PurchA]","[InventoryPN]= [PN] And
[InventoryLocation]= 'F Stor'"),"No Value")
 
G

Guest

Thank you, Thank you, Thank you!

Ofer said:
The NZ function will return any value that you want incase of a null, but you
have to specify what value you want it to return

That what you have
=Nz(DLookUp("[InvQty]","[PurchA]","[InventoryPN]= [PN] And
[InventoryLocation]= 'F Stor'"))

To return 0, change it to
=Nz(DLookUp("[InvQty]","[PurchA]","[InventoryPN]= [PN] And
[InventoryLocation]= 'F Stor'"),0)

To return a string saying no value
=Nz(DLookUp("[InvQty]","[PurchA]","[InventoryPN]= [PN] And
[InventoryLocation]= 'F Stor'"),"No Value")
--
I hope that helped
Good luck


neenmarie said:
I'm had a DLookUp working on a report, but also need it to return a value of
zero if there is no info to return. Here is the code that worked before I
put the Nz( ) in.
[InvQty] is a number. Everything else is text. Pls help....

=Nz(DLookUp("[InvQty]","[PurchA]","[InventoryPN]= [PN] And
[InventoryLocation]= 'F Stor' "))
 
G

Guest

Your welcome, Your welcome, Your welcome
--
I hope that helped
Good luck


neenmarie said:
Thank you, Thank you, Thank you!

Ofer said:
The NZ function will return any value that you want incase of a null, but you
have to specify what value you want it to return

That what you have
=Nz(DLookUp("[InvQty]","[PurchA]","[InventoryPN]= [PN] And
[InventoryLocation]= 'F Stor'"))

To return 0, change it to
=Nz(DLookUp("[InvQty]","[PurchA]","[InventoryPN]= [PN] And
[InventoryLocation]= 'F Stor'"),0)

To return a string saying no value
=Nz(DLookUp("[InvQty]","[PurchA]","[InventoryPN]= [PN] And
[InventoryLocation]= 'F Stor'"),"No Value")
--
I hope that helped
Good luck


neenmarie said:
I'm had a DLookUp working on a report, but also need it to return a value of
zero if there is no info to return. Here is the code that worked before I
put the Nz( ) in.
[InvQty] is a number. Everything else is text. Pls help....

=Nz(DLookUp("[InvQty]","[PurchA]","[InventoryPN]= [PN] And
[InventoryLocation]= 'F Stor' "))
 

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

Similar Threads

Help with IIF / DLookup formula 6
DLookup can't find a value 13
DlookUp Syntax problem 12
Dlookup( One more thing... 2
Dlookup Help 5
nz with dlookup 1
Access DLOOKUP with IF Function in MS ACCESS DB 0
Nz in a DLookup control ? 12

Top