Please change qryClosure to Closure for testing purposes
Sub llamar()
Call OnHandAged_Hernan(1, #6/19/2019#, #6/19/2019#)
End Sub
Function OnHandAged_Hernan(ProgramId As Variant, RptDate As Variant, AgeDate As Variant) As Long
Dim DB As Database
Dim RS As Recordset
Dim rs2 As Recordset
Dim...