Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-08-2007, 02:15 PM
gwp1 gwp1 is offline
Novice
evaluating a text expression in a form field
 
Join Date: Oct 2007
Location: Anchorage, Alaska
Posts: 1
gwp1
Default evaluating a text expression in a form field

Hi,



Quickly put : The formfield calculation =if(m2<>"..","12","") gives me a syntax error. Why?

My question is at the bottom. The rest of this is background. But I'm so lost, I feel I need to give this background if only to assure myself I'm asking the right question.

I've searched and searched and searched, and the closest thing I can come up with are answers for Word's mergefields, which are apparently different than formfields - I think. At any rate the answers for mergefields look wrong to me. They contain {} squiggly lines and I havent ever used squiggly lines in my other formfield calculations.

I've re-created the CMS1500 healthcare claim form on Word 2003. Here's a link to a PDF version of the form (not my form) http://nucc.org/images/stories/PDF/cms_1500_sample.pdf. In fact, I'll probably be useful to look at that cause then I can refer to the numbered boxes on that form for my question.

I have the entire form laden with formfields, some of which duplicate themselves through REF-bookmark, and others that are automatic, such as the CURRENTDATE formfield next to a signature box.

I've also created two calculation fields: One to calculate the total dollars, and the other to add the total cents. The reason I'm not just calculating the total amount (i.e. Text1 + Text2 +...) is because the dollars and cents are entered seperately into the form, and so the total also needs to keep the dollars and cents seperate.

The total cents (Box 28-right) are calculated in a formfield as : =(((Cents1 + Cents2 + Cents3 + Cents4 + Cents5 + Cents6)/100)-int((Cents1 + Cents2 + Cents3 + Cents4 + Cents5 + Cents6)/100))*100

The total dollars (Box 28-left) are calculated as : =(Dollar1 + Dollar2 + Dollar3 + Dollar4 + Dollar5 + Dollar6)+int((Cents1 + Cents2 + Cents3 + Cents4 + Cents5 + Cents6)/100)

The Cents refer to the 6 lines on the claim form, box 24f, where I've placed a formfield for the cents on each line. The Dollars refer to the same part of the form, and refer to the dollars on each line. Basically the Cents calculation takes the total and then keeps only the decimal places (the cents). The Dollar calculation is similar, but adds in the integer from the cents total. Keep in mind that cents are entered into the Cents fields as whole numbers (because they're their own number). In other words 50-cents is entered as "50", not ".50", and that's the reason for dividing by 100 throughout the calculations (the INT integer calculation requires it).

The entire form works very well, but I want to add more. I've included all this so you know that I'm working in formfields and not mergefields (if there's a difference). Like I've said I've found answers for mergefields and they refer to a bunch of expressions with these squiggly things {} around them. That's not what I'm doing...I don't think. Anyway you've now seen above what I can do, so I think the answer needs to be in the same vein? format? style? I'm new to all this calculation stuff.

Ok, my question :

Why isn't the formfield calculation =if(m2<>"..","12","") working? I keep getting a syntax error regarding the quotes. I've tried single quotes, no quotes, etc...

I've also tried the expression this way =if(m2<>TwoDots,Text156,DefaultBlank) and this, while it doesn't give me a syntax error, still doesn't work. m2 refers to a formfield for a month number "01" - "12". TwoDots refers to a formfield containing the default text ".." (without quotes). Text 156 refers to a formfield containing the default text "12" (without quotes). DefaultBlank also refers to a formfield containing the default text ".." (without quotes). The result is either "12" which is good, or "0" which I dont want.

Here's what I want : If (on the claim form) 24a is blank or contains two dots ".." then box 24b should be ".." (no quotes). If box 24a is greater than 1 (in other words contains a month-number 01, 02, 03...12) then box 24b should be "12" (no quotes).

Your answer will assist in many other, similar calculations for this form. And now that I've placed so much background here, my other posts shouldnt be a long. Thank you.

- Eric

(i know, long post)
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Templates: automatic text generation from Rich Text content control Chickenmunga Word 0 10-01-2008 11:16 AM
Cells with wrap text not showing text lazylew Excel 1 08-31-2008 06:58 AM
Searchable & Sortable field crobertson Outlook 0 12-17-2007 09:37 AM
MS Word Field Tab Control? mycon73 Word 0 09-24-2007 07:46 AM
Printing BCC field John Strung Outlook 4 11-22-2005 04:48 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 07:46 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft