troubleshooting Question

Left$ question

Avatar of SteveL13
SteveL13Flag for United States of America asked on
Microsoft Access
5 Comments1 Solution221 ViewsLast Modified:
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.

Join our community to see this answer!
Unlock 1 Answer and 5 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros