DLookUp

  • Thread starter Thread starter DS
  • Start date Start date
D

DS

I have a DLookUp problem I think it's in the Format part. It returns an
#Error message.
Thanks
DS

=DLookUp("Format([ConcernPCTStart],'#%') & "" To""' &
Format([ConcernPctEnd],'#%')","tblConcern","ConcernID=0")
 
You're trying to pull 2 fields value if I read your Dlookup properly.

=DLookUp("Format([ConcernPCTStart],'#%') & "" To""' &
Format([ConcernPctEnd],'#%')","tblConcern","ConcernID=0")

According to the help file: "use the DLookup function to get the value of a
particular field", as such it cannot do what you are wanting. Instead you'll
need to perform a Dllokup for each field and then concatenate them
separately. Also your format function should be outside the Dlookup.

sStart=Format(DLookUp("ConcernPCTStart]","tblConcern","ConcernID=0"), '#%')
sEnd=Format(DLookUp("[ConcernPCTStart]","tblConcern","ConcernID=0") ,'#%')

MsgBox sStart & " To" & sEnd

You might also want to take a look at http://allenbrowne.com/ser-42.html as
an alternative to Dlookup
--
Hope this helps,

Daniel Pineault
http://www.cardaconsultants.com/
For Access Tips and Examples: http://www.devhut.com/index.php
Please rate this post using the vote buttons if it was helpful.
 
Back
Top