Home » Developer & Programmer » Forms » Calculation Mode Formula item... Cant Save WHY?????
Calculation Mode Formula item... Cant Save WHY????? [message #159133] Thu, 16 February 2006 06:00 Go to next message
kamran.it
Messages: 265
Registered: September 2005
Location: Karachi
Senior Member
Dear All

I have three feilds a,b,c

I define a formula in calculation mode
****(define in C field)***
Calulation mode = fomula
formula= a+b*100
summary function = none

formaula working properly but field "C" dont save in table.

Kamran
Re: Calculation Mode Formula item... Cant Save WHY????? [message #159139 is a reply to message #159133] Thu, 16 February 2006 06:21 Go to previous messageGo to next message
vban2000
Messages: 207
Registered: March 2005
Senior Member
Hi

Is your Database Item (for item c) set to YES?
and the Column Name for it.

HTH

regards
AnDy
Re: Calculation Mode Formula item... Cant Save WHY????? [message #159145 is a reply to message #159139] Thu, 16 February 2006 06:46 Go to previous messageGo to next message
kamran.it
Messages: 265
Registered: September 2005
Location: Karachi
Senior Member
Hi dear

Data base item set = yes

I am enable to understand why it is not saving??

Kamran

[Updated on: Thu, 16 February 2006 06:46]

Report message to a moderator

Re: Calculation Mode Formula item... Cant Save WHY????? [message #159176 is a reply to message #159133] Thu, 16 February 2006 09:17 Go to previous messageGo to next message
vban2000
Messages: 207
Registered: March 2005
Senior Member
any error message??

did other data (a,b) got saved ??

regards
AnDy
Re: Calculation Mode Formula item... Cant Save WHY????? [message #159267 is a reply to message #159176] Fri, 17 February 2006 01:38 Go to previous messageGo to next message
kamran.it
Messages: 265
Registered: September 2005
Location: Karachi
Senior Member
Hi

No there is no error msg and A,B is saved.

Actual a,b,c both are number(6)

Please tell me as soon.


Thanks
Re: Calculation Mode Formula item... Cant Save WHY????? [message #159289 is a reply to message #159133] Fri, 17 February 2006 03:34 Go to previous messageGo to next message
vban2000
Messages: 207
Registered: March 2005
Senior Member
Hi Kamran

Sad I have no idea~~~

use message to output c at pre-insert and check what value it is dispalyed.. (or if any value at all)

try to do some testing, run the form in the debug mode and trace the value of c.

regards
AnDy

Re: Calculation Mode Formula item... Cant Save WHY????? [message #159404 is a reply to message #159289] Sat, 18 February 2006 09:31 Go to previous messageGo to next message
Mohannad
Messages: 47
Registered: January 2006
Location: palestine
Member

hi man
u can open the help and read a bout that.

Re: Calculation Mode Formula item... Cant Save WHY????? [message #160395 is a reply to message #159404] Sat, 25 February 2006 00:43 Go to previous messageGo to next message
kamran.it
Messages: 265
Registered: September 2005
Location: Karachi
Senior Member
hi all

Please help me I am facing a problem in form

****** three feilds a,b,c

****(define in C field)***

I define a formula in calculation mode

Calulation mode = formula
formula= a+b*100
summary function = none

formaula is working properly but field "C" dont save in table. why??????

there is no error and database item.
Kamran
Re: Calculation Mode Formula item... Cant Save WHY????? [message #160405 is a reply to message #160395] Sat, 25 February 2006 04:05 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
This may be a nonsense, but - did you save changes in the form? Clicking on the "Save" button, pressing <KEY-COMMIT> or perform "commit;" on any other way?
Re: Calculation Mode Formula item... Cant Save WHY????? [message #160409 is a reply to message #160405] Sat, 25 February 2006 04:38 Go to previous messageGo to next message
kamran.it
Messages: 265
Registered: September 2005
Location: Karachi
Senior Member
dear

I have done this but problem still here.!!!!!!!!!

Re: Calculation Mode Formula item... Cant Save WHY????? [message #160427 is a reply to message #160409] Sat, 25 February 2006 09:29 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Oh well ... just a little bit of reading on-line Forms help and everything is much clearer.

Go to the help system and search for "Creating a Calculated Item". In there, you'll find "Creating a calculated item Restrictions", which says:
Quote:

The following item properties are defaulted to NO at compilation time:
- database item
etc.
Therefore, although the item "database item" property is set to Yes, it will be invalidated and at runtime your "c" item will be a control item.

In order to make your formula work, create a control item (for example "c_calc") (as suggested in the Help), make it a Formula column and enter the formula you want.
To store formula item value into the database, create PRE-INSERT trigger on the block; it will have only one line:

:block.c := :block.c_calc;

That should do it.

[EDIT]
By the way, Mohannad (in post #7) suggested you to read Help last Saturday. Being busy last week?

[Updated on: Sat, 25 February 2006 09:32]

Report message to a moderator

Re: Calculation Mode Formula item... Cant Save WHY????? [message #160492 is a reply to message #160427] Sun, 26 February 2006 23:39 Go to previous messageGo to next message
kamran.it
Messages: 265
Registered: September 2005
Location: Karachi
Senior Member
thanks my dear & best regards
Re: Calculation Mode Formula item... Cant Save WHY????? [message #160498 is a reply to message #159133] Mon, 27 February 2006 00:00 Go to previous messageGo to next message
Atul P
Messages: 61
Registered: June 2003
Location: Mumbai-Jakarta
Member

Calculated items are display-only control items.

1.Calculated items cannot be database items.
2.While you can set a calculated item's Enabled, Mouse Navigate, and Keyboard Navigable properties to Yes,
you cannot set the Insert Allowed or Update Allowed properties to Yes.


So NI Pre-Insert and Pre-update write
Your DB Column Name = :C


Rgds
Atul P

Re: Calculation Mode Formula item... Cant Save WHY????? [message #160506 is a reply to message #160498] Mon, 27 February 2006 01:02 Go to previous message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Actually:
IF Your DB Column Name != :C THEN
  Your DB Column Name = :C
END IF;
David
Previous Topic: form with no heading
Next Topic: host name
Goto Forum:
  


Current Time: Fri Sep 20 06:27:36 CDT 2024