This doesn't work in Access 2013!

papic1972

Registered User.
Local time
Tomorrow, 08:04
Joined
Apr 14, 2004
Messages
122
Hi everyone,

I've just upgraded to Access 2013 (after using Access 2003->2007->2010 over an 11 year period) and I'm having a infuriating time trying to figure out why my continuous subform field is now displaying #ERROR in Access 2013 (after working successfully in all previous Access versions!)

My subform field PaymentReceived calls a Function named PaymentRec()

Public Function PaymentRec() As Currency
If IsNull(DLookup("[SumofPaymentReceived]", "[qryDlookupDebtPrelimTOTAL]", "[ID]= " & [id])) Then
PaymentRec = 0
Else
PaymentRec = DLookup("[SumofPaymentReceived]", "[qryDlookupDebtPrelimTOTAL]", "[ID]= " & [id])
End If


End Function

"SumofPaymentReceived" is the sum of a currency field "PaymentReceived" (which is in a SQL table ODBC linked to my Access 2013 frontend).

Has anyone had a similar problem with this??

Thanks in advance!
 
try simply

PaymentRec = nz(DLookup("[SumofPaymentReceived]", "[qryDlookupDebtPrelimTOTAL]", "[ID]= " & [id]),0)
 
Hi Dave,

Thank you, I gave that a shot however I'm still receiving the same error. I'm perplexed as to why this is happening. I've checked on another workstation in my office that is still running Access 2003 and I'm not receiving this error.
 
try compiling the whole thing, and also checking your references, in case it's some side effect
 
OK thanks, i'll try that now and post my result.
 
I've checked all of the references. I also created a new fresh blank database in Access 2013 format and imported all components, all to no avail. I'm stumped, don't know what to do.
 
Just to close off this post, I've re-created the queries that generate the Dlookups & all is working now. (Strange why I'd have to do this in the first place though!)
 

Users who are viewing this thread

Back
Top Bottom