DLookup type mismatch error (1 Viewer)

Jmsteph

Registered User.
Local time
Today, 15:49
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 & "'")
 

MSAccessRookie

AWF VIP
Local time
Today, 16:49
Joined
May 2, 2008
Messages
3,428
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?
 

Jmsteph

Registered User.
Local time
Today, 15:49
Joined
Dec 2, 2008
Messages
28
The type for all of the fields is text.
 

Jmsteph

Registered User.
Local time
Today, 15:49
Joined
Dec 2, 2008
Messages
28
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
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 13:49
Joined
Aug 30, 2003
Messages
36,127
Remove the items in red:

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

Jmsteph

Registered User.
Local time
Today, 15:49
Joined
Dec 2, 2008
Messages
28
That was it. Thank you both for your help!!!!!!
 

MSAccessRookie

AWF VIP
Local time
Today, 16:49
Joined
May 2, 2008
Messages
3,428
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

Top Bottom