Quartekoen Posted June 27, 2008 Posted June 27, 2008 (edited) Okay, first let me say that this is not going to be an actual 'Find', and I expect all of this to be done in Browse mode (hopefully). Here's my situation: When a user creates an invoice, they have to specify how the entire order will be shipped. This is done by entering it into a SHIP field. There are many ways that the order can be shipped, such as by freight, UPS ground, ect... But the user needs to enter extra data if they choose to ship by UPS. The type of UPS shipment may be different, such as UPS ground, UPS air, UPS dropshipment, etc... I'm wondering if there's any way to create a script that will check to see if the SHIP field starts with UPS, and if it does, then go to another layout for extra data input. I don't think there should be an extra dropdown menu for UPS shipments, since the user may not realize they have to enter UPS, and then go to another field to choose the rest of the shipment type. Is there just a way to get the first word of a string so that it can be compared? Thanks. Edited June 27, 2008 by Guest
_henry_ Posted June 27, 2008 Posted June 27, 2008 Hi, Have you tried Leftwords (text;numberofWords)? Here is the example from FM's help: LeftWords("Plaid Canvas Suitcase";2) returns Plaid Canvas. LeftWords(Name;1) returns Sophie, when the Name field contains Sophie Tang. Hope that answer your question.
Quartekoen Posted June 27, 2008 Author Posted June 27, 2008 Hmm. As long as it delimits the words by spaces, it should do exactly what I need. Thanks.
_henry_ Posted June 27, 2008 Posted June 27, 2008 You're right. Also, if it's delimited by another string such as | (pipe) or another unique char, you can try to use the Substitute function to change the unique delimiter to the space. :]
Fitch Posted June 27, 2008 Posted June 27, 2008 Spaces are not the only word delimiters, FYI. Also check out some of the other text functions such as Left, Position, and PatternCount.
Recommended Posts
This topic is 5994 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now