Solved

CODES IN NOTES FIELD If then statement - then error

Posted on 2011-02-21
3
324 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

910 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

Need Help in Real-Time?

Connect with top rated Experts

28 Experts available now in Live!

Get 1:1 Help Now