Board index » delphi » How to edit calculated field (urgent , please help)
Marek
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
|
Marek
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
How to edit calculated field (urgent , please help)
I would like to be able to edit the calculated field when new record is
inserting (to translate this field into the database table field in 'BeforePost' event...) I use standard DBGrid, and after 'INSERT' (pressed TDBNavigator button) I cannot enter any data into the calculated fields (ReadOnly field property is FALSE !) - but I really need to do it. Could anybody give me a solution ? |
Roald Simonse
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:How to edit calculated field (urgent , please help)I dont think you can manually edit a calkulated field. Have you tried to insert the value using OnCalcFields? Regards Marek <ver...@idirect.ca> wrote in article <36d39dd...@nemo.idirect.com>... Quote> I would like to be able to edit the calculated field when new record is |
Marco Roc
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:How to edit calculated field (urgent , please help)QuoteOn Wed, 24 Feb 1999 01:51:39 -0600, "Marek" <ver...@idirect.ca> wrote: a value other than the one you calculate in the OnCalcFields handler. Calculated fields will not be written to the db as well, because they If "you really need to do it" then maybe you really don't want a Regards, -- |
Mare
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:How to edit calculated field (urgent , please help)Hi, Marco I appreciate your comments. Probably I was 'to short' in my previous posting if you can spend few minutes looking at my problem I would be really greatful... I exactly know what the calculated fields are and I know the main The problem is: I have to handle old-big database (for many reasons cannot Now my users need to enter some data. They want to be able to enter data When my user select 'Insert' button from DBNavigator, they can see whole Warm thanks for any additional hints. QuoteMarco Rocci wrote in message <36da06af.12651...@news.tin.it>... |
Robert Kapla
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:How to edit calculated field (urgent , please help)You are referring to something that I wished many times I had, a "temporary" field. My way to fake it is as follows: 1. Create the fields in the SELECT statment by casting spaces or zeros SELECT REALFIELD1, REALFIELD2, CAST (" " AS CHAR(20)) AS TEMP1, The result set will contain all the fields you have selected, INCLUDING the 2. Before opening the query, disconnect controls, open the query, loop thru 3. Use a TUpdateSQL (is that the name? the thingie you hook up to the query Hope this helps. Robert QuoteMarek wrote in message <36d4733...@nemo.idirect.com>... |
Ruben van Leeuwe
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:How to edit calculated field (urgent , please help)Hi Marek, I know exaclty what you mean and have had the same sort of problems. What I Cheers, QuoteMarek wrote: |
Marco Roc
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:How to edit calculated field (urgent , please help)QuoteOn Wed, 24 Feb 1999 16:54:16 -0800, "Marek" <m...@tradition.ca> wrote: solving your problem. I always use CachedUpdates, so I prefer Robert's solution, because I just eliminate the two "temporary" fields from the TUpdateObject I already have. Ruben's solution might be simpler if you don't usually use I suggest you use TDataSet.OnAfterScroll and TDataSet.OnNewRecord to Regards, -- |
Steve Hig
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:How to edit calculated field (urgent , please help)I'm not sure whether this helps but let me explain how I coped with a similar problem with displaying a weight. I wanted to display a weight as, for example, 9-7 for 9 stone 7 pounds, but I wanted to store the value as 133 (number of pounds) in my database. The initial way was to generate the stones and pounds as calculated fields, but as you have pointed out this does not allow you to update the value. So I used the Onsettext and ongettext methods of the field to ensure that Steve QuoteMarco Rocci wrote in message <36d512d9.2574...@tor-nn1-ca.netcom.ca>... |
Mare
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:How to edit calculated field (urgent , please help)Thank you very much everybody ! I see my topic was a spark for the 'brain's storm'... You are so friendly, (and so good in Delphi ) folks. Good luck. QuoteMarek wrote in message <36d39dd...@nemo.idirect.com>... |
Ruben van Leeuwe
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:How to edit calculated field (urgent , please help)Hi Marco, Personally I prefer the sql way, but in our company we use an Apollo database, Cheers from Holland, QuoteMarco Rocci wrote: |
1. How to edit calculated field (urgent, please help)
2. URGENT, help me please: Problem using 2 lookup field based on a master/detail
3. Calculated Fields (Calculated & Internal Calculated)
4. Calculated fields - URGENT !!!
5. * URGENT * Please can someone help me * URGENT *
6. Q: How to edit a calculated field in a DBGrid
7. Using Cached Updates for editing a Calculated Field.
8. Q: How to edit a calculated field in a DBGrid