View Full Version : Addnew rounding up numbers


Steve2003
07-03-2003, 03:30 AM
I am opening a recordset and then running the code below. This code runs fine apart from the fact that it is rounding up and figures that have decimal places. ie 2.6 becomes 3 in the table and cannot be changed back to 2.6. The only way is too set the properties of the table field to text which is not what I want to do as I need the fields to be numbers not text.

Any help would be much appreciated.

With tbl
.AddNew

!BonusDateRatesApplied = Me.R_BonusDate
!AnnualSApc = Me.R_CurrentAnnualRate
!AnnualRBApc = Me.R_CurrentReversionaryRate
!TBonSA = Me.TBSA
!TBonRBA = Me.TBRBA
!EMVWithAppliedRates = Me.txtTempEMV
!ToBePrinted = Me.txtfrmHeader
.Update
.Bookmark = .LastModified

End With


Thanks

Steve

dcx693
07-03-2003, 03:42 AM
Hmm....I'm pretty sure that .AddNew, if you're applly the method to a recordset, just adds a new record. It doesn't affect the rounding of anything.

You state that your data type is numeric. Make sure your data type is not long integer (the default) or some other type that cannot accept decimals. IOW, your data type needs to be single or long.

Steve2003
07-03-2003, 03:57 AM
Thank you dcx693 problem solved.
I did not realise that long integer did not accept decimals.

Thank you!!!:) :)