Snuggle Walrus
Member
- Local time
- Today, 03:21
- Joined
- May 14, 2020
- Messages
- 32
Hey all! Hopefully something simple, I think i'm just brainfarting this code, i'm trying to use a Variable to store a Dlookup value. I want to look up the "Unit Price" of the selected item from my Purchase Orders Details table.
I'm getting type mismatch errors, I think its how i'm using my " and ' but i cant for the life of me seem to work it out at the moment. Both CurrentPOID and CurrentPID are variables storing Integers, have already been declared and are storing information correctly (used a msgbox to check). Thanks everyone!
Code:
CurrentBuyPrice = DLookup("[Unit Price]", "[tbl_PurchaseOrdersDetails]", "[POID]= '" & CurrentPOID & "' And [ProductID]= '" & CurrentPID & "'")
I'm getting type mismatch errors, I think its how i'm using my " and ' but i cant for the life of me seem to work it out at the moment. Both CurrentPOID and CurrentPID are variables storing Integers, have already been declared and are storing information correctly (used a msgbox to check). Thanks everyone!