Type mismatch bewilderment

jon jomaco

Registered User.
Local time
Today, 22:16
Joined
May 20, 2005
Messages
41
Hey, I found this website on google and had a search around to see if I could find a few answers to some problems. It has helped a lot, however, I have stumbled upon the type mismatch error. I have used some of suggested ideas on other threads (such as using 's) but still can't figure out why I am getting it.

Here is the code i am using:

Me.[OrderTotal] = DSum("OrderValue", "tblOrderLink", "OrderID ='" & Me.[OrderID] & "'")

I believe it's something to do with the end bit:

"OrderID ='" & Me.[OrderID] & "'

Since if i put in the ID that has to be found manually e.g. "OrderID = 22" (for the argument) it works fine.

Hope you can help, any information appreciated
Jon.
 
Your [OrderID] is numeric so leave off the single quotes:
Code:
Me.[OrderTotal] = DSum("OrderValue", "tblOrderLink", "OrderID =" & Me.[OrderID] )
 
Excellent, that works fine. I didn't realise that you do not have to put the " " around the whole thing.
Thanks a lot,
Jon.
 
Last edited:

Users who are viewing this thread

Back
Top Bottom