In Access 2002 i have a function on a subreport the is returning #error. It works fine on the main reprt
Its control source is
=UseDefaultCodes([ProductCode],"CARTSTAFF")
The [ProductCode] is the link to the master form
The code is
Public Function UseDefaultCodes(PCode As String, ExpCode As String)
UseDefaultCodes = DLookup("[DeFaultAmt]", "Costcodes", "([Costcodes].[COSTCODE]) = '" & ExpCode & "'")
End If
End Function
Any Ideas
Its control source is
=UseDefaultCodes([ProductCode],"CARTSTAFF")
The [ProductCode] is the link to the master form
The code is
Public Function UseDefaultCodes(PCode As String, ExpCode As String)
UseDefaultCodes = DLookup("[DeFaultAmt]", "Costcodes", "([Costcodes].[COSTCODE]) = '" & ExpCode & "'")
End If
End Function
Any Ideas