Error in Forms Calculation

F

Frank Camean

For some reason, outlook is taking a summarized formula
into "character position totals" rather than a global
summary.

Example: I want to calculate TOTAL OPERATING EXPENSES. I
created 3 user fields. TOTAL OE1, TOTAL OE2, and TOTAL
OE3. where each field represents a list of summarized
expenses. TOTAL OPERATING INCOME = [TOTAL OE1]+[TOTAL OE2]
+[TOTAL OE3]

I had to break it out into 3 user fields because I
couldn't fit all the values into TOTAL OPERATING INCOME
(the window space wouldn't allow me to).

When I "RUN" the form, the calculation works, but when I
actually put it to use, A DATE TIME STAMP GETS POPULATED
IN THERE. (and I can't figure out why?)

Should I do the calculation in CODE? If so, how would I
do that.

TOTAL OE1 = [Bathroom Expense]+[Bedroom Expense]+[Dining
Room Expense] + etc....

something similar for OE2 and OE3. I would like to just
have TOTAL OPERATING EXPENSES = A+B+C+D+E+F+G... ETC...

What's the proper syntax in code? Or how can I fix this
w/out code? Any guidance/advice is greatly appreciated.
Thanks in advance.
 
S

Sue Mosher [MVP-Outlook]

I've seen sporadic reports of this, but have never been able to duplicate
it. Are all the fields numeric or currency? How many total custom fields are
on the form? Outlook version?

In code, it looks like this:

Item.UserProperties("TOTAL OPERATING EXPENSES") = _
Item.UserProperties("TOTAL OE1") + _
Item.UserProperties("TOTAL OE3") + _
Item.UserProperties("TOTAL OE3")

You can use the Item_Write or Item_CustomPropertyChange event handler to
perform the calculations. See http://www.outlookcode.com/d/propsyntax.htm
for more on Outlook property syntax.
 
F

Frank Camean

Sue,

I have about 481 user fields so far. The formula at times
outputs like this...

Say TOTAL OE1 = 5, TOTAL OE2=12, AND TOTAL OE3=7

The output reads 5127

Instead of adding 5, plus 12, plus 7, it just lines the
totals right next to each other. Rather odd.

The fields are all currency. Outlook version is Microsoft
Outlook 2002 for XP. I'll try the formula behind code.
To do so, do I just go to VIEW CODE and type the code as
you suggested?

Thanks.


-----Original Message-----
I've seen sporadic reports of this, but have never been able to duplicate
it. Are all the fields numeric or currency? How many total custom fields are
on the form? Outlook version?

In code, it looks like this:

Item.UserProperties("TOTAL OPERATING EXPENSES") = _
Item.UserProperties("TOTAL OE1") + _
Item.UserProperties("TOTAL OE3") + _
Item.UserProperties("TOTAL OE3")

You can use the Item_Write or Item_CustomPropertyChange event handler to
perform the calculations. See http://www.outlookcode.com/d/propsyntax.htm
for more on Outlook property syntax.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



Frank Camean said:
For some reason, outlook is taking a summarized formula
into "character position totals" rather than a global
summary.

Example: I want to calculate TOTAL OPERATING EXPENSES. I
created 3 user fields. TOTAL OE1, TOTAL OE2, and TOTAL
OE3. where each field represents a list of summarized
expenses. TOTAL OPERATING INCOME = [TOTAL OE1]+[TOTAL OE2]
+[TOTAL OE3]

I had to break it out into 3 user fields because I
couldn't fit all the values into TOTAL OPERATING INCOME
(the window space wouldn't allow me to).

When I "RUN" the form, the calculation works, but when I
actually put it to use, A DATE TIME STAMP GETS POPULATED
IN THERE. (and I can't figure out why?)

Should I do the calculation in CODE? If so, how would I
do that.

TOTAL OE1 = [Bathroom Expense]+[Bedroom Expense]+[Dining
Room Expense] + etc....

something similar for OE2 and OE3. I would like to just
have TOTAL OPERATING EXPENSES = A+B+C+D+E+F+G... ETC...

What's the proper syntax in code? Or how can I fix this
w/out code? Any guidance/advice is greatly appreciated.
Thanks in advance.


.
 
F

Frank Camean

Sue,

I went to VIEW>>>CODE and typed in the following:

Item.UserProperties("Total Operating Expenses") = _
Item.UserProperties("Total OE1") + _
Item.UserProperties("Total OE2") + _
Item.UserProperties("Total OE3")

When I run the form, I get the following error prompt:

Script Error: Line No.1

Am I typing something wrong? Forgive my ignorance
please. I'm new to this.

-----Original Message-----
I've seen sporadic reports of this, but have never been able to duplicate
it. Are all the fields numeric or currency? How many total custom fields are
on the form? Outlook version?

In code, it looks like this:

Item.UserProperties("TOTAL OPERATING EXPENSES") = _
Item.UserProperties("TOTAL OE1") + _
Item.UserProperties("TOTAL OE3") + _
Item.UserProperties("TOTAL OE3")

You can use the Item_Write or Item_CustomPropertyChange event handler to
perform the calculations. See http://www.outlookcode.com/d/propsyntax.htm
for more on Outlook property syntax.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



Frank Camean said:
For some reason, outlook is taking a summarized formula
into "character position totals" rather than a global
summary.

Example: I want to calculate TOTAL OPERATING EXPENSES. I
created 3 user fields. TOTAL OE1, TOTAL OE2, and TOTAL
OE3. where each field represents a list of summarized
expenses. TOTAL OPERATING INCOME = [TOTAL OE1]+[TOTAL OE2]
+[TOTAL OE3]

I had to break it out into 3 user fields because I
couldn't fit all the values into TOTAL OPERATING INCOME
(the window space wouldn't allow me to).

When I "RUN" the form, the calculation works, but when I
actually put it to use, A DATE TIME STAMP GETS POPULATED
IN THERE. (and I can't figure out why?)

Should I do the calculation in CODE? If so, how would I
do that.

TOTAL OE1 = [Bathroom Expense]+[Bedroom Expense]+[Dining
Room Expense] + etc....

something similar for OE2 and OE3. I would like to just
have TOTAL OPERATING EXPENSES = A+B+C+D+E+F+G... ETC...

What's the proper syntax in code? Or how can I fix this
w/out code? Any guidance/advice is greatly appreciated.
Thanks in advance.


.
 
S

Sue Mosher [MVP-Outlook]

My guess is that your form is too large and complex. 481 fields is likely to
be way too many. I start getting anxious at 200.

Are TOTAL OE1 etc. created as currency fields or formula fields?

As I said in my earlier message, you have to decide what event to use to run
your code -- Write or CustomPropertyChange. All Outlook form code is event
driven.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



Frank Camean said:
Sue,

I have about 481 user fields so far. The formula at times
outputs like this...

Say TOTAL OE1 = 5, TOTAL OE2=12, AND TOTAL OE3=7

The output reads 5127

Instead of adding 5, plus 12, plus 7, it just lines the
totals right next to each other. Rather odd.

The fields are all currency. Outlook version is Microsoft
Outlook 2002 for XP. I'll try the formula behind code.
To do so, do I just go to VIEW CODE and type the code as
you suggested?

Thanks.


-----Original Message-----
I've seen sporadic reports of this, but have never been able to duplicate
it. Are all the fields numeric or currency? How many total custom fields are
on the form? Outlook version?

In code, it looks like this:

Item.UserProperties("TOTAL OPERATING EXPENSES") = _
Item.UserProperties("TOTAL OE1") + _
Item.UserProperties("TOTAL OE3") + _
Item.UserProperties("TOTAL OE3")

You can use the Item_Write or Item_CustomPropertyChange event handler to
perform the calculations. See http://www.outlookcode.com/d/propsyntax.htm
for more on Outlook property syntax.


Frank Camean said:
For some reason, outlook is taking a summarized formula
into "character position totals" rather than a global
summary.

Example: I want to calculate TOTAL OPERATING EXPENSES. I
created 3 user fields. TOTAL OE1, TOTAL OE2, and TOTAL
OE3. where each field represents a list of summarized
expenses. TOTAL OPERATING INCOME = [TOTAL OE1]+[TOTAL OE2]
+[TOTAL OE3]

I had to break it out into 3 user fields because I
couldn't fit all the values into TOTAL OPERATING INCOME
(the window space wouldn't allow me to).

When I "RUN" the form, the calculation works, but when I
actually put it to use, A DATE TIME STAMP GETS POPULATED
IN THERE. (and I can't figure out why?)

Should I do the calculation in CODE? If so, how would I
do that.

TOTAL OE1 = [Bathroom Expense]+[Bedroom Expense]+[Dining
Room Expense] + etc....

something similar for OE2 and OE3. I would like to just
have TOTAL OPERATING EXPENSES = A+B+C+D+E+F+G... ETC...

What's the proper syntax in code? Or how can I fix this
w/out code? Any guidance/advice is greatly appreciated.
Thanks in advance.


.
 
S

Sue Mosher [MVP-Outlook]

You can read about the Write and CustomPropertyChange events in VBA help,
but I'd suggest that if you want to use the latter, you also read about it
on the web page I suggested earlier.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



Frank Camean said:
Sue,

I went to VIEW>>>CODE and typed in the following:

Item.UserProperties("Total Operating Expenses") = _
Item.UserProperties("Total OE1") + _
Item.UserProperties("Total OE2") + _
Item.UserProperties("Total OE3")

When I run the form, I get the following error prompt:

Script Error: Line No.1

Am I typing something wrong? Forgive my ignorance
please. I'm new to this.

-----Original Message-----
I've seen sporadic reports of this, but have never been able to duplicate
it. Are all the fields numeric or currency? How many total custom fields are
on the form? Outlook version?

In code, it looks like this:

Item.UserProperties("TOTAL OPERATING EXPENSES") = _
Item.UserProperties("TOTAL OE1") + _
Item.UserProperties("TOTAL OE3") + _
Item.UserProperties("TOTAL OE3")

You can use the Item_Write or Item_CustomPropertyChange event handler to
perform the calculations. See http://www.outlookcode.com/d/propsyntax.htm
for more on Outlook property syntax.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



Frank Camean said:
For some reason, outlook is taking a summarized formula
into "character position totals" rather than a global
summary.

Example: I want to calculate TOTAL OPERATING EXPENSES. I
created 3 user fields. TOTAL OE1, TOTAL OE2, and TOTAL
OE3. where each field represents a list of summarized
expenses. TOTAL OPERATING INCOME = [TOTAL OE1]+[TOTAL OE2]
+[TOTAL OE3]

I had to break it out into 3 user fields because I
couldn't fit all the values into TOTAL OPERATING INCOME
(the window space wouldn't allow me to).

When I "RUN" the form, the calculation works, but when I
actually put it to use, A DATE TIME STAMP GETS POPULATED
IN THERE. (and I can't figure out why?)

Should I do the calculation in CODE? If so, how would I
do that.

TOTAL OE1 = [Bathroom Expense]+[Bedroom Expense]+[Dining
Room Expense] + etc....

something similar for OE2 and OE3. I would like to just
have TOTAL OPERATING EXPENSES = A+B+C+D+E+F+G... ETC...

What's the proper syntax in code? Or how can I fix this
w/out code? Any guidance/advice is greatly appreciated.
Thanks in advance.


.
 

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