S
Scott
I'm trying to use Dlookup to generate output for a field
on a report. The Dlookup procedure is being called by a
function on the report. I know the variable is being
passed correction to the code module, my problem seems to
be getting Dlookup to read the variable correctly. If I
insert static entries where I'm trying to use a variable
the right results are returned. If anyone can look at
the following simple code and see where I'm going wrong
it will help.
Function PROVIDERINQUIRY(PROVIDERNUMBER)
If IsNull(DLookup("[NAME]", "PROVIDER", "[PROVID]
+'PROVIDERNUMBER'")) Then
PROVIDERINQUIRY = PROVIDERNUMBER
Else
PROVIDERINQUIRY = (DLookup
("[HEADNAME]", "PROVIDER", "[PROVID]='PROVIDERNUMBER'"))
End If
End Function
on a report. The Dlookup procedure is being called by a
function on the report. I know the variable is being
passed correction to the code module, my problem seems to
be getting Dlookup to read the variable correctly. If I
insert static entries where I'm trying to use a variable
the right results are returned. If anyone can look at
the following simple code and see where I'm going wrong
it will help.
Function PROVIDERINQUIRY(PROVIDERNUMBER)
If IsNull(DLookup("[NAME]", "PROVIDER", "[PROVID]
+'PROVIDERNUMBER'")) Then
PROVIDERINQUIRY = PROVIDERNUMBER
Else
PROVIDERINQUIRY = (DLookup
("[HEADNAME]", "PROVIDER", "[PROVID]='PROVIDERNUMBER'"))
End If
End Function