DLookup type mismatch error

Jmsteph

Registered User.
Local time
Today, 08:16
Joined
Dec 2, 2008
Messages
28
Hello,

I am working on a Financial trading platform and am getting a type mismatch error when running the below DLookup.

What I am trying to do is find a fund number on the trading table were the fund name on the trade form matches the fund name on the trading table. I also need the product on the trade table to match the product on the trade form as the fund number is different for each fund depending on what product the customer purchased. Any help is greatly appreciated!!!

Me.Fund_1 = DLookup("[Fund#]", "TradeFundInfo", "[FundName]='" & Me.FromFund1 & "'" And "[Product]='" & Me.ProductCombo & "'")
 
Hello,

I am working on a Financial trading platform and am getting a type mismatch error when running the below DLookup.

What I am trying to do is find a fund number on the trading table were the fund name on the trade form matches the fund name on the trading table. I also need the product on the trade table to match the product on the trade form as the fund number is different for each fund depending on what product the customer purchased. Any help is greatly appreciated!!!

Me.Fund_1 = DLookup("[Fund#]", "TradeFundInfo", "[FundName]='" & Me.FromFund1 & "'" And "[Product]='" & Me.ProductCombo & "'")

Since the structure of the DLookup seems fine, I woud have to ask the following questions:
  • What is the Type for Me.Fund_1?
    • Does TradeFundInfo.[Fund#] have the same type?
  • What is the Type for Me.FromFund1?
    • Does TradeFundInfo.[FundName] have the same type?
    [*]What is the Type for Me.ProductCombo?
    • Does TradeFundInfo.[Product] have the same type?
 
The type for all of the fields is text. Sorry I am self taught so there could be something really stupid that I am doing that would cause this error.
Thanks,

JS
 
Remove the items in red:

Me.Fund_1 = DLookup("[Fund#]", "TradeFundInfo", "[FundName]='" & Me.FromFund1 & "'" And "[Product]='" & Me.ProductCombo & "'")
 
That was it. Thank you both for your help!!!!!!
 
Remove the items in red:

Me.Fund_1 = DLookup("[Fund#]", "TradeFundInfo", "[FundName]='" & Me.FromFund1 & "'" And "[Product]='" & Me.ProductCombo & "'")


Good Catch! I missed that one :(. At least the Op has an answer that works.
 

Users who are viewing this thread

Back
Top Bottom