Solved

Access 2000 need an alternative to NZ function

Posted on 2007-03-22
10
641 Views
Last Modified: 2013-11-27
I am using the NZ function in the fiels location.
Notes: NZ([purchaseorderdetail].[Notes],"")

I am having trouble importing this query into a 3rd party program. This program doesn't like this NZ function. When I take out the NZ function it imports perfectly. When I put the NZ function back into my query, the program doesn't want to connect. It says " Value cannot be null. Parameter name: adodb."

I need another way to do my NZ function without using it in the field location, so my 3rd party program will connect to my query.
Please let me know if you need more info or clarity.
Thanks
0
Comment
Question by:mancoi
  • 3
  • 2
  • 2
  • +2
10 Comments
 

Author Comment

by:mancoi
ID: 18773833
I posted a screen shot of the details section of my query.

http://download.yousendit.com/CDCE878C630B8DC5

 
0
 
LVL 44

Assisted Solution

by:Arthur_Wood
Arthur_Wood earned 50 total points
ID: 18773842
try this in place of the NZ function:

Notes: [purchaseorderdetail].[Notes] & ""

this will append a "" (zero-length string) onto the values from the table, which will *not* affect notes that have real text, but will convert any NULL values to a zero-length string, which is precisely what your use of the NZ function is doing.


AW
0
 
LVL 119

Expert Comment

by:Rey Obrero
ID: 18773862
try this

Notes: NZ([purchaseorderdetail].[Notes],Null)

Is the [Notes] field allow zero length property set to yes
0
 
LVL 38

Assisted Solution

by:Jim P.
Jim P. earned 50 total points
ID: 18773911
These are foreign tables in Paradox?  That you are connecting using ADO?

You'll have to dig around in the Paradox guide for that function. In Transact SQL (MS SQL version of SQL) the function is IsNull(MyField,'').
Oracle uses NVL(MyField,'').
0
 
LVL 65

Assisted Solution

by:Jim Horn
Jim Horn earned 100 total points
ID: 18773950
The below code is the VB equivalent of Nz, as VB does not have Nz.  Perhaps you can re-write it to be Paradox-friendly...
____
Public Function Nz(vValue as Variant, Optional vValueIfNull as Variant) as Variant

If Not IsNull(vValue)
   Nz = vValue
elseif IsNull(vValue) and (Not IsNull(vValueIfNull) then
   Nz = vValueIfNull
elseif IsNull(vValue) and IsNull(vValueIfNull)
  'User passed null values in both vValue and vValueIfNull.  Put what you want here, like...
   Nz = ""
end if

End Function
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

by:mancoi
ID: 18782346

Check this site out.....

How can I change my function to an IIF function? I am using ......Notes: NZ([purchaseorderdetail].[Notes],"")

http://tutorials.aspfaq.com/8000xxxxx-errors/can-i-use-the-nz-function-without-getting-80040e14-errors.html
0
 
LVL 119

Accepted Solution

by:
Rey Obrero earned 300 total points
ID: 18782655
Notes:IIf(Len([purchaseorderdetail].[Notes])>0,[purchaseorderdetail].[Notes],"")
0
 

Author Comment

by:mancoi
ID: 18782677
Got it using an IIF I will award points....THANKS
0
 
LVL 38

Expert Comment

by:Jim P.
ID: 18782852
Glad to be of assistance. May all your days get brighter and brighter.
0
 
LVL 44

Expert Comment

by:Arthur_Wood
ID: 18783720
glad to be of assistance.

AW
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now