Undefined function 'Nz' in expression

D

Daniel Melero

Hi, I'm getting that error message when I am executing a
query.

SQLquery = "SELECT tbl_call_log.Shipper, Nz([tbl_locn].
[District]) AS District, tbl_call_log.Dest_Unit, "
SQLquery = SQLquery & "tbl_call_log.ID, Nz
([tbl_call_log].[SCAC]) AS SCAC,
tbl_call_log.Late_Ctgy_Maj, "
SQLquery = SQLquery & "tbl_call_log.Late_Ctgy_Sub,
tbl_call_log.Delay_Unit, tbl_call_log.Orig_Appt_Dt, "
SQLquery = SQLquery & "tbl_call_log.Booking_Number,
tbl_call_log.Orig_Appt_Tm, tbl_call_log.Contact_Orig, "
SQLquery = SQLquery & "tbl_call_log.Rev_Appt_Dt,
tbl_call_log.Rev_Appt_Tm, tbl_call_log.Cust_Rev_Appt_Dt,
tbl_call_log.Cust_Rev_Appt_Tm, tbl_call_log.Act_Del_Dt,
tbl_call_log.Act_Del_Tm "
SQLquery = SQLquery & " FROM tbl_locn INNER JOIN
tbl_call_log ON tbl_locn.Dest_Unit =
tbl_call_log.Dest_Unit"
SQLquery = SQLquery & " GROUP BY tbl_call_log.Shipper,
Nz([tbl_locn].[District]), tbl_call_log.Dest_Unit, "
SQLquery = SQLquery & "tbl_call_log.ID, Nz
([tbl_call_log].[SCAC]), tbl_call_log.Late_Ctgy_Maj,
tbl_call_log.Late_Ctgy_Sub, "
SQLquery = SQLquery & "tbl_call_log.Delay_Unit,
tbl_call_log.Orig_Appt_Dt, tbl_call_log.Booking_Number,
tbl_call_log.Orig_Appt_Tm, "
SQLquery = SQLquery & "tbl_call_log.Contact_Orig,
tbl_call_log.Rev_Appt_Dt, tbl_call_log.Rev_Appt_Tm,
tbl_call_log.Cust_Rev_Appt_Dt, "
SQLquery = SQLquery & "tbl_call_log.Cust_Rev_Appt_Tm,
tbl_call_log.Act_Del_Dt, tbl_call_log.Act_Del_Tm"
SQLquery = SQLquery & HavingString
SQLquery = SQLquery & " ORDER BY tbl_call_log.Shipper,
tbl_call_log.Dest_Unit, tbl_call_log.Orig_Appt_Dt,
tbl_call_log.Booking_Number;"

Set rs = db.OpenRecordset(SQLquery, dbOpenDynaset)


Can someone help? Thanks in advance.
 
J

John Vinson

Hi, I'm getting that error message when I am executing a
query.

This appears to be the very common References bug. Open any
module in design view, or open the VBA editor by typing
Ctrl-G. Select Tools... References from the menu. One of the
..DLL files required by Access will probably be marked
MISSING. Uncheck it, recheck it, close and open Access.

If none are MISSING, check any reference; close and open
Access; then uncheck it again. This will force Access to
relink the libraries.
 
D

Daniel Melero

Thanks. It worked. Do you know why the Links get lost? or
what causes them to lose the links?
 
J

John Vinson

Thanks. It worked. Do you know why the Links get lost? or
what causes them to lose the links?

I sure wish I did; I'd sell the fix to Microsoft and retire on the
proceeds.

Apparently it's just part of "DLL Hell" - the complexity of the
Windows registry and file linkage. Sometimes installing a completely
unrelated program can cause this problem to arise.
 

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

Top