Hi there,
Just a bit confused at the moment & would love some help .
All other fields in this table are ok except this one.
I'm no access genius, I was reluctant to pay $15000 for a weighbridge
program so I made one myself.
The control source is as follows for the Trailer 1 Nett field,
=[Trailer 1 Gross]-[Trailer 1 Tare]
The numbers(& result) are,
41.08-34.28 = 6.800003 (should display as just 6.8)
It just seems to be ignoring all the decimal formats (set to 2) we have
place which are working perfectly everywhere else except for this 1 record.
Thanks in advance.
|
|
0
|
|
|
|
Reply
|
Utf
|
12/5/2007 5:07:00 AM |
|
On Tue, 4 Dec 2007 21:07:00 -0800, Joshua J wrote:
> Hi there,
>
> Just a bit confused at the moment & would love some help .
>
> All other fields in this table are ok except this one.
>
> I'm no access genius, I was reluctant to pay $15000 for a weighbridge
> program so I made one myself.
>
> The control source is as follows for the Trailer 1 Nett field,
> =[Trailer 1 Gross]-[Trailer 1 Tare]
> The numbers(& result) are,
> 41.08-34.28 = 6.800003 (should display as just 6.8)
>
> It just seems to be ignoring all the decimal formats (set to 2) we have
> place which are working perfectly everywhere else except for this 1 record.
>
> Thanks in advance.
=Format([Trailer 1 Gross]-[Trailer 1 Tare],"#.00")
Will return 2 decimals.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
|
|
0
|
|
|
|
Reply
|
fredg
|
12/5/2007 6:07:05 AM
|
|
On Tue, 4 Dec 2007 21:07:00 -0800, Joshua J
<JoshuaJ@discussions.microsoft.com> wrote:
>Hi there,
>
>Just a bit confused at the moment & would love some help .
>
>All other fields in this table are ok except this one.
>
>I'm no access genius, I was reluctant to pay $15000 for a weighbridge
>program so I made one myself.
>
>The control source is as follows for the Trailer 1 Nett field,
>=[Trailer 1 Gross]-[Trailer 1 Tare]
>The numbers(& result) are,
>41.08-34.28 = 6.800003 (should display as just 6.8)
>
>It just seems to be ignoring all the decimal formats (set to 2) we have
>place which are working perfectly everywhere else except for this 1 record.
>
>Thanks in advance.
It appears that you're using a Single Float size number. Floating point
numbers, by their nature, are approximations - a single float is accurate to
about 7 decimal places. Just as the fraction 1/7 cannot be represented exactly
as a decimal number, so the fraction 1/100 (or 1/10) cannot be represented
exactly as a binary fraction - and therefore not as a floating point number.
I'd suggest not using a Number datatype for this field at all; instead, use a
Currency datatype. A Currency field is a huge scaled integer which stores
exactly four decimal places, no more, no fewer; you can hide some of those
four digits by setting the Format or decimal places properties, but they're
still there.
Or, you can use
=Round([Trailer 1 Gross]-[Trailer 1 Tare], 2)
to round the result to two decimal places. I'd really suggest a Currency
datatype though.
John W. Vinson [MVP]
|
|
0
|
|
|
|
Reply
|
John
|
12/5/2007 6:53:54 AM
|
|
On Tue, 4 Dec 2007 22:07:05 -0800, fredg <fgutkind@example.invalid> wrote:
>On Tue, 4 Dec 2007 21:07:00 -0800, Joshua J wrote:
>
>> Hi there,
>>
>> Just a bit confused at the moment & would love some help .
>>
>> All other fields in this table are ok except this one.
>>
>> I'm no access genius, I was reluctant to pay $15000 for a weighbridge
>> program so I made one myself.
>>
>> The control source is as follows for the Trailer 1 Nett field,
>> =[Trailer 1 Gross]-[Trailer 1 Tare]
>> The numbers(& result) are,
>> 41.08-34.28 = 6.800003 (should display as just 6.8)
>>
>> It just seems to be ignoring all the decimal formats (set to 2) we have
>> place which are working perfectly everywhere else except for this 1 record.
>>
>> Thanks in advance.
>
> =Format([Trailer 1 Gross]-[Trailer 1 Tare],"#.00")
>
> Will return 2 decimals.
.... as a text string, not as a number, however. Good idea for display, but may
cause trouble for further calculations!
John W. Vinson [MVP]
|
|
0
|
|
|
|
Reply
|
John
|
12/5/2007 6:54:41 AM
|
|
Thanks Guys. Good result. Happy Xmas
"John W. Vinson" wrote:
> On Tue, 4 Dec 2007 21:07:00 -0800, Joshua J
> <JoshuaJ@discussions.microsoft.com> wrote:
>
> >Hi there,
> >
> >Just a bit confused at the moment & would love some help .
> >
> >All other fields in this table are ok except this one.
> >
> >I'm no access genius, I was reluctant to pay $15000 for a weighbridge
> >program so I made one myself.
> >
> >The control source is as follows for the Trailer 1 Nett field,
> >=[Trailer 1 Gross]-[Trailer 1 Tare]
> >The numbers(& result) are,
> >41.08-34.28 = 6.800003 (should display as just 6.8)
> >
> >It just seems to be ignoring all the decimal formats (set to 2) we have
> >place which are working perfectly everywhere else except for this 1 record.
> >
> >Thanks in advance.
>
> It appears that you're using a Single Float size number. Floating point
> numbers, by their nature, are approximations - a single float is accurate to
> about 7 decimal places. Just as the fraction 1/7 cannot be represented exactly
> as a decimal number, so the fraction 1/100 (or 1/10) cannot be represented
> exactly as a binary fraction - and therefore not as a floating point number.
>
> I'd suggest not using a Number datatype for this field at all; instead, use a
> Currency datatype. A Currency field is a huge scaled integer which stores
> exactly four decimal places, no more, no fewer; you can hide some of those
> four digits by setting the Format or decimal places properties, but they're
> still there.
>
> Or, you can use
>
> =Round([Trailer 1 Gross]-[Trailer 1 Tare], 2)
>
> to round the result to two decimal places. I'd really suggest a Currency
> datatype though.
>
> John W. Vinson [MVP]
>
|
|
0
|
|
|
|
Reply
|
Utf
|
12/11/2007 10:49:00 PM
|
|
|
4 Replies
319 Views
(page loaded in 0.122 seconds)
Similiar Articles: Inserting Calculation / Expression in a Form - microsoft.public ...The calculation is a simple addition for the grand total ... will not calculate the values for me - I get an error stating that I need to edit the Control's Control Source ... correzzione indirzzo errato - microsoft.public.accessti mando questa mail cos ti rimane in memoria la mia mail saluti ... Control Source calculation error Utf 4 146 Sum error on continous subform - microsoft.public.access.forms ...Its > field name (control source) is ... the expression used for the calculation ... continuous subform, and set its Control Source like this: =Sum ... I have #Error ... If query/subform is empty set calculation value to 0 - microsoft ...... for the item), and in this case, i get a #Error ... If query/subform is empty set calculation value to 0 ... set query crieria by reference of form control in access ... Running Total from a Subform - microsoft.public.access.forms ...... by using the following as > the Control Source ... > >> You need to repeat the calculation, not reference the calculated control. ... the form, my header gives me a #Error ... Null Value in reports - microsoft.public.accessBelow is my calculation > that I have on control source on my form. If 'A' is null I am getting the > #error message. Do you know how I use Isnull or NZ function to ... Changing ControlSource property on a subform - microsoft.public ...... myChild!myField.ControlSource = "ChangedControlSource" <= ERROR HERE ... Change subform record order - microsoft.public ... on a ... calculation in the control source ... Microsoft Access 2007 RecordsetClone doesn't work - microsoft ...... use a function as the control's control source and put the calculation ... But, version 2007 has this error ... used to work as part of a control's control source, but if ... Need calculated control to work - microsoft.public.access.forms ...... View, you could add a text box to its Form Footer section, and set the Control Source to ... Without error handling: > > Function RecordsInForm(frm As Form) As Long ... How do I sort on a calculated field in a report? - microsoft ...You got the error because your expression used control names instead of field names. ... You can use the same calculation in the report's record source query as Ofer ... Error Detection and Control in Data Transfer - TKK - TMLThe receiver also performs the same calculation on the ... Error control is a method that can be used to recover the ... test results on 18.2M dataset, w/program source, 14. Solved: Access 2007 #Name? error in form calculation - Tech ...Re: overlapping field list and form calculation control ... T1 start]+6) , it generates the same error. That suggests to me maybe a problem with the control source for ... I see #Error displayed in a control - Access - Office.com... You see #Error displayed in a control. Cause Access displays #Error in a control when ... reference if you have two controls that specify each other in their control source. MS ACCESS :: Form Footer Calculation ErrorForm Footer Calculation Error I have a simple tabular form with the following: ... that has this (=Round([TotalHoursPoss]*[PercentField])*0.27) in the control source ... Create a calculated control - Access - Office.comThe Control Source property of the calculated text box contains an ... report, however, it may be useful to base a check box control on the results of a calculation ... 7/16/2012 8:18:35 PM
|