Error - UNEXPECTED END OF FORMULA

G

Guest

I'm using Word 2003, creating a form fill document using fields/formulas to
pull data from a source in a custom program which is integrated with Word.

I’ve entered a formula to pull a dollar value from the data. If there is an
amount in the field in the form it pulls perfectly with the commas in the
correct places.

However, if the field in the data base is blank I get the following error
message UNEXPECTED END OF FORMULA.

My formula looks like this:

${=<DATA FIELD>\# #,###}

It's ok if the field is left blank, in other words, I don't need to use an
IF statement to remove the blank space.

What am I doing wrong? Why isn't just leaving the field in my document
blank if the field in the data base is blank?

Thx
 
M

macropod

Hi Dee

'<DATA FIELD>' doesn't represent a valid filed name. So, what you've got is Word trying to evaluate '=<' (ie equal to or less
than)DATA against 'FIELD' followed by '>' (ie greater than) '\#'.

Cheers
 
D

Dee

Sorry let me clarify - I realize DATA FIELD isn't a valid field name. I typed
in 'DATA FIELD' simply to resprent the actual field name because I am using
various field names in this document (I should have explained that). I am
using valid field names in the actual document. The formula works as long as
there is data in the field that I'm pulling from. My problem is - when the
field has been left blank on the data base, I get the error message
UNEXPECTED END OF FORMULA.

Can anyone help?

Thx
Dee

macropod said:
Hi Dee

'<DATA FIELD>' doesn't represent a valid filed name. So, what you've got is Word trying to evaluate '=<' (ie equal to or less
than)DATA against 'FIELD' followed by '>' (ie greater than) '\#'.

Cheers
--
macropod
[MVP - Microsoft Word]
-------------------------

Dee said:
I'm using Word 2003, creating a form fill document using fields/formulas to
pull data from a source in a custom program which is integrated with Word.

I’ve entered a formula to pull a dollar value from the data. If there is an
amount in the field in the form it pulls perfectly with the commas in the
correct places.

However, if the field in the data base is blank I get the following error
message UNEXPECTED END OF FORMULA.

My formula looks like this:

${=<DATA FIELD>\# #,###}

It's ok if the field is left blank, in other words, I don't need to use an
IF statement to remove the blank space.

What am I doing wrong? Why isn't just leaving the field in my document
blank if the field in the data base is blank?

Thx
 
M

macropod

Hi Dee,

So where is your data field coming from? An ASK field, formfield, mailmerge? And how is that configured?

Cheers
--
macropod
[MVP - Microsoft Word]
-------------------------

Dee said:
Sorry let me clarify - I realize DATA FIELD isn't a valid field name. I typed
in 'DATA FIELD' simply to resprent the actual field name because I am using
various field names in this document (I should have explained that). I am
using valid field names in the actual document. The formula works as long as
there is data in the field that I'm pulling from. My problem is - when the
field has been left blank on the data base, I get the error message
UNEXPECTED END OF FORMULA.

Can anyone help?

Thx
Dee

macropod said:
Hi Dee

'<DATA FIELD>' doesn't represent a valid filed name. So, what you've got is Word trying to evaluate '=<' (ie equal to or less
than)DATA against 'FIELD' followed by '>' (ie greater than) '\#'.

Cheers
--
macropod
[MVP - Microsoft Word]
-------------------------

Dee said:
I'm using Word 2003, creating a form fill document using fields/formulas to
pull data from a source in a custom program which is integrated with Word.

I’ve entered a formula to pull a dollar value from the data. If there is an
amount in the field in the form it pulls perfectly with the commas in the
correct places.

However, if the field in the data base is blank I get the following error
message UNEXPECTED END OF FORMULA.

My formula looks like this:

${=<DATA FIELD>\# #,###}

It's ok if the field is left blank, in other words, I don't need to use an
IF statement to remove the blank space.

What am I doing wrong? Why isn't just leaving the field in my document
blank if the field in the data base is blank?

Thx
 
D

Dee

Hi,

My data fields are coming from a custom program that has word integrated
into it. Unless you are, or have been in the insurance business the odds of
you being familiar with the system are probably slim - but it's called The
Agency Manager or TAM. It's a multi functional system that allows us to
enter client data, create & store documents, attach docs, pics, emails etc.
We can run reports that pull data, we can create formletter that pull data
etc. In this case I am creating a formletter and telling it to pull specific
fields from various places in the system.

I can create a word doc, then I can insert ASK fields, IF statements etc.
There is a menu I can go to that will assist in writing IF statements. If I
want to pull data from the system I have to use the appropriate menus from
within the system. Then I can customize them once they are in the doc. In
this case I have created IF statements and then customized them.

The formula works fine as long as there is data in the field. It's only
when a field is blank in the data base that I get the error.

Hope this clarifies.

Thx,
Dee

macropod said:
Hi Dee,

So where is your data field coming from? An ASK field, formfield, mailmerge? And how is that configured?

Cheers
--
macropod
[MVP - Microsoft Word]
-------------------------

Dee said:
Sorry let me clarify - I realize DATA FIELD isn't a valid field name. I typed
in 'DATA FIELD' simply to resprent the actual field name because I am using
various field names in this document (I should have explained that). I am
using valid field names in the actual document. The formula works as long as
there is data in the field that I'm pulling from. My problem is - when the
field has been left blank on the data base, I get the error message
UNEXPECTED END OF FORMULA.

Can anyone help?

Thx
Dee

macropod said:
Hi Dee

'<DATA FIELD>' doesn't represent a valid filed name. So, what you've got is Word trying to evaluate '=<' (ie equal to or less
than)DATA against 'FIELD' followed by '>' (ie greater than) '\#'.

Cheers
--
macropod
[MVP - Microsoft Word]
-------------------------

I'm using Word 2003, creating a form fill document using fields/formulas to
pull data from a source in a custom program which is integrated with Word.

I’ve entered a formula to pull a dollar value from the data. If there is an
amount in the field in the form it pulls perfectly with the commas in the
correct places.

However, if the field in the data base is blank I get the following error
message UNEXPECTED END OF FORMULA.

My formula looks like this:

${=<DATA FIELD>\# #,###}

It's ok if the field is left blank, in other words, I don't need to use an
IF statement to remove the blank space.

What am I doing wrong? Why isn't just leaving the field in my document
blank if the field in the data base is blank?

Thx
 
M

macropod

Hi Dee,

The "!Unexpected End of Formula" message usually indicates that the formula construction is itself faulty. For example, a missing
bracket or operator. I'd expect a formula invoking an empty field to return something like "!Zero Divide" or "!Undefined Bookmark,
#".

Be that as it may, you can suppress all of these error messages via coding like:
{IF{Expression}= "!*" 0 {Expression}}
or
{IF{Expression}= "!Unexpected End of Formula" 0 {Expression}}
for just this error,
where {Expression} is the field, or part of the field, that is causing problems. Before putting that into production, though, I'd
encourage you to test all possible scenarios to make sure the results are what you want. Simply hiding errors without understanding
their cause is not something I'd recommend.

Cheers
--
macropod
[MVP - Microsoft Word]
-------------------------

Dee said:
Hi,

My data fields are coming from a custom program that has word integrated
into it. Unless you are, or have been in the insurance business the odds of
you being familiar with the system are probably slim - but it's called The
Agency Manager or TAM. It's a multi functional system that allows us to
enter client data, create & store documents, attach docs, pics, emails etc.
We can run reports that pull data, we can create formletter that pull data
etc. In this case I am creating a formletter and telling it to pull specific
fields from various places in the system.

I can create a word doc, then I can insert ASK fields, IF statements etc.
There is a menu I can go to that will assist in writing IF statements. If I
want to pull data from the system I have to use the appropriate menus from
within the system. Then I can customize them once they are in the doc. In
this case I have created IF statements and then customized them.

The formula works fine as long as there is data in the field. It's only
when a field is blank in the data base that I get the error.

Hope this clarifies.

Thx,
Dee

macropod said:
Hi Dee,

So where is your data field coming from? An ASK field, formfield, mailmerge? And how is that configured?

Cheers
--
macropod
[MVP - Microsoft Word]
-------------------------

Dee said:
Sorry let me clarify - I realize DATA FIELD isn't a valid field name. I typed
in 'DATA FIELD' simply to resprent the actual field name because I am using
various field names in this document (I should have explained that). I am
using valid field names in the actual document. The formula works as long as
there is data in the field that I'm pulling from. My problem is - when the
field has been left blank on the data base, I get the error message
UNEXPECTED END OF FORMULA.

Can anyone help?

Thx
Dee

:

Hi Dee

'<DATA FIELD>' doesn't represent a valid filed name. So, what you've got is Word trying to evaluate '=<' (ie equal to or less
than)DATA against 'FIELD' followed by '>' (ie greater than) '\#'.

Cheers
--
macropod
[MVP - Microsoft Word]
-------------------------

I'm using Word 2003, creating a form fill document using fields/formulas to
pull data from a source in a custom program which is integrated with Word.

I’ve entered a formula to pull a dollar value from the data. If there is an
amount in the field in the form it pulls perfectly with the commas in the
correct places.

However, if the field in the data base is blank I get the following error
message UNEXPECTED END OF FORMULA.

My formula looks like this:

${=<DATA FIELD>\# #,###}

It's ok if the field is left blank, in other words, I don't need to use an
IF statement to remove the blank space.

What am I doing wrong? Why isn't just leaving the field in my document
blank if the field in the data base is blank?

Thx
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top