Solved

CODES IN NOTES FIELD If then statement - then error

Posted on 2011-02-21
3
326 Views
Last Modified: 2012-05-11
I'm not very good at doing any of this but I'm learing. I'm trying to decipher a from a list of 14 codes which get entered into a notes field. The codes are supposed to be the first items entered into the field but at times I've notice a space before they start the codes. I'm trying to find where all the errors are in the fields when the users enter the incorrect codes. The reason is im' trying to create groups for these specific codes only but keep getting other codes because they aren't entered correctly. I have started what I thought would work and it does for the first code and if I stop there the formula works fine, but I need the other 13 to work as well. Any ideas. I keep getting a "The keyword 'then' is missing in the below formula. I know I'm obviously doing something wrong but I don't know what?

IF Left({View_RscMaster_History.Staffing_Note_Vc},2 ) = "MS" or
IF Left({View_RscMaster_History.Staffing_Note_Vc},3 ) = "CAR" or
IF Left({View_RscMaster_History.Staffing_Note_Vc},4 ) = "CMTE" or
IF Left({View_RscMaster_History.Staffing_Note_Vc},4 ) = "SPEC" or
IF Left({View_RscMaster_History.Staffing_Note_Vc},4 ) = "BFHM" or
IF Left({View_RscMaster_History.Staffing_Note_Vc},4 ) = "INST" or
IF Left({View_RscMaster_History.Staffing_Note_Vc},5 ) = "BFPAR" or
IF Left({View_RscMaster_History.Staffing_Note_Vc},5 ) = "BFSCH" or
IF Left({View_RscMaster_History.Staffing_Note_Vc},5 ) = "EVENT" or
IF Left({View_RscMaster_History.Staffing_Note_Vc},5 ) = "NREMT" or
IF Left({View_RscMaster_History.Staffing_Note_Vc},5 ) = "HMSCH" or
IF Left({View_RscMaster_History.Staffing_Note_Vc},6 ) = "FRSTYR" or
IF Left({View_RscMaster_History.Staffing_Note_Vc},7 ) = "FIREINV" or
IF Left({View_RscMaster_History.Staffing_Note_Vc},7 ) = "CPRINST" then "" else  "WRONG CODE"
0
Comment
Question by:RandyMFire
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 77

Accepted Solution

by:
peter57r earned 125 total points
ID: 34944225
Remove all the 'IF's except the first one.
0
 

Author Comment

by:RandyMFire
ID: 34944360
Thanks. That was it.
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 34945010
If there are leading spaces you could use TRIM or LTRIM to remove them before testing

mlmcc
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

735 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question