Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Access 2000 need an alternative to NZ function

Posted on 2007-03-22
10
Medium Priority
?
708 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 200 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 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 18773862
try this

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

Is the [Notes] field allow zero length property set to yes
0
Vim Reference Guide

Vim is a powerful text editor favored by many sysadmins and developers - here are some commands that you'll want to keep in your back pocket!

 
LVL 38

Assisted Solution

by:Jim P.
Jim P. earned 200 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 66

Assisted Solution

by:Jim Horn
Jim Horn earned 400 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
 

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 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 1200 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

722 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