In have a report that has the following onprint event in the detail section of the report.
If Me.chkbxDirectShip = True Then
Me.txtEaPrice = DLookup("[ATPriceEa]", "tblParts", "[PartN] = '" & Me.txtPartN & "'")
End If
But the "me.txtPartN" portion of the code needs to be the left characters of the txtPartN up to the first space in the txtPartN. I know this may be confusing but can someone help?
In other words, if the actual PartN is "123456 - Test" then I want it to think the PartN is "123456" (ignoring the rest of the string).
I've tried:
Me.txtEaPrice = DLookup("[ATPriceEa]", "tblParts", "[PartN] = '" & Left$, Me.txtPartN & "'")
but that isn't even close I'm sure.
Split(txtpartn, " ")(0)