Thread: DLookup problem
07-26-14, 07:09 #1Registered User
- Join Date
- Jul 2014
Unanswered: DLookup problem
I have just joined this forum as I am trying to get to grips with MS Access 2013. I apologise if I have posted this in the wrong place!
I am sure that I am about to ask a very simple question... But this is driving me mad!!
What is wrong with this Dlookup formula?
=DLookUp("[UnitPrice]","Order Details","OrderID = " & [Forms]![Orders]![UnitPrice])
I am trying to look up Unit Price from a form (Order Details) based on a value in a text box on a form (Orders).
This is not rocket science, I know... but it just returns #Type! when I run the form and I cannot work out why.
I have trawled forums etc and have found many solutions for more complicated Dlookup requests. I have copied and Pasted this from the MS help function to try and learn how it works and just cannot get it to complete
07-26-14, 14:26 #2Jaded Developer
Provided Answers: 59
- Join Date
- Nov 2004
- out on a limb
You are telling the dlookup to look for an orderID that matches the value in a control called unitprice. Unless you have been especially liberal with you column and control names that doesnt look right to me.
a type error normally suggests the Access runtime is being supplied with a value with anincompatable datatype, which is possible if the unitprice control is formatted as a currency datatype.I'd rather be riding on the Tiger 800 or the Norton