Article

From:
To:
All
Subject:
Twwdbedit doesn't accept right value
Newsgroup:
woll2woll.infopower
 

Twwdbedit doesn't accept right value

with IPStudioWin 5.0.3.4 the below component doesn't work as I expect.
At design time I set the associated field
IBDts_FieldsIMPNZ.DisplayFormat := '#,###,###,###,##0.00 
;#,###,###,###,##0.00-;#';

I go in Insert mode and 1st time I enter value in the control - if I type -50 it get -50 (ok) - if I type 50- I get 50 (not ok)
retyping same control 2nd time if I type 50- I get -50 (ok)
I post record and insert another record , problem comes back as at beginning.
I think it depends on initial value NULL that has the inserted record.
If I edit the record, the component which shows a value works fine 50- returns 50- , another edit component which comes with null value works as abobe type 50- returns 50
Could you suggest a workaround to normalize the result, we are used to type - sign at the end of input.
Regards Adalberto Baldini --------------------------------------------------------------------------- object wDBEdt_ImpNz: TwwDBEdit   Left = 92   Top = 22   Width = 154   Height = 20   Hint = 'Importo in Valuta Nazionale'   AutoSize = False   BorderStyle = bsNone   DataField = 'IMPNZ'   DataSource = wDs_Fields   Font.Charset = DEFAULT_CHARSET   Font.Color = clWindowText   Font.Height = -12   Font.Name = 'MS Reference Sans Serif'   Font.Style = []   Frame.Enabled = True   Frame.NonFocusBorders = [efLeftBorder, efTopBorder, efRightBorder, efBottomBorder]   Frame.FocusStyle = efsFrameSunken   Frame.NonFocusStyle = efsFrameSunken   ParentFont = False   TabOrder = 0   UnboundDataType = wwDefault   UsePictureMask = False   WantReturns = False   WordWrap = False   OnExit = wDBEdt_ImpNzExit end procedure Tfrm_RegCoge.wDBEdt_ImpNzExit(Sender: TObject); var valore, valore1 : Double; begin valore := (sender as TwwDBEdit).DataSource.Dataset.FieldByName((sender as    TwwDBEdit).DataField).AsFloat ; if valore < 0 then   (sender as TwwDBEdit).Font.Color := clRed else (sender as TwwDBEdit).Font.Color := clWindowText;
end; Adalberto Baldini
FYI: Phrase searches are enclosed in either single or double quotes
 
 
Originally created by
Tamarack Associates
Thu, 28 Mar 2024 08:24:51 UTC
Copyright © 2009-2024
HREF Tools Corp.