function returning #Name?

M

Mark Kubicki

I have the below function entered as the default value on a subform;
unfortunately, the only result it yields is: #Name?
To my untrained eyes, it looks fine, but maybe i'm missing the obvious?
does anyone have any suggestions on where I ought tobe looking for the
error?

as always, thanks in advance,
-mark



Public Function PrintOrder(frm As Access.Form)
vStr = "[Type] = '" & frm.Parent.Type & "'"
varx = DLookup("[Type]", "tblInstallationNotes", vStr)
vLen = Len(Nz(varx))
If vLen > 0 Then
PrintOrder = DMax("[PrintOrder]", "tblInstallationNotes") + 1
Else
PrintOrder = 1
End If
End Function
 
Top