entryfield changes when clicking

  • Thread starter Jean-Paul De Winter
  • Start date
J

Jean-Paul De Winter

Hi,
I have this entryfield that contains a value with 2 decimals.
The notation is "Euro"
When the form is opened the value of this entryfield is calculated.
When I move the cursor into the entryfield and click, I get a number
with 4 or even more decimals...
How can this be avoided?
Thanks
JP
 
M

Marshall Barton

Jean-Paul De Winter said:
I have this entryfield that contains a value with 2 decimals.
The notation is "Euro"
When the form is opened the value of this entryfield is calculated.
When I move the cursor into the entryfield and click, I get a number
with 4 or even more decimals...
How can this be avoided?


When you move the focus to the text box, it must display the
actual, unformatted value so you can edit what's really in
the field.

If you don't want to see more than 2 decimals, don't enter
values with so many decimals ;-)

Maybe you can figure a way to calculate/round/truncate the
value to 2 places before you set the control's value??

If the field in the table is a Single or Double, the extra
decimals might be coming from the normal imprecision of
those data types. If this is the case, change the field to
type Currency, which maintains 4 decimals with complete
accuracy.
 
J

Jean-Paul De Winter

the entryfield is the result of a calculation... can I limit the amount
of decimals?
JP
 
J

Jean-Paul De Winter

the calculation comes from a query
JP

Jean-Paul De Winter said:
the entryfield is the result of a calculation... can I limit the amount
of decimals?
JP
 
M

Marshall Barton

What do you want to do with the "extra" digits?

If you want to round them to two decimals, use:
Round(field, 2)

If you just want to throw them away:
Fix(field * 100) / 100
 
J

Jean-Paul De Winter

when I do this I get a #error....

Currently the value in the field is Pay2therapist
I changed it to round(pay2therapist,2)
result.... error

The value is displayed like 123,45€
When I click on the field the € is gone and the value changes to 123,4987

Hope you can help
JP
 
M

Marshall Barton

Which error? Unknown function? Type mismatch? Something
else?

What version/SR/SP of Access are you using?

The Euro sign is part of the format. Since it is not part
of the number, you will not see it while editing the value.
 
J

Jean-Paul De Winter

No matter what syntax I use I get:
#name
#error
in the entryfield itself

I use access 2003

Thanks for your kind help
 
M

Marshall Barton

I really need more information. You said the query field
now has the expression: round(pay2therapist,2) which, by
itself will do what I think you asked for. But now I think
you are talking about how it shows up on the form. If so, I
need to know what name you assigned the field in the query
and the text box's record source. Most likely you forgot to
keep the text box connected to the field from the query. Or
maybe you have an expression in the text box that refers to
the name of the text box.

I am still confused about the objective here. I think you
started out by being disturbed by the number displaying too
many decimals when you were editing the the value in a text
box on the form. You then said that the value was the
result of a calculation in the query, so I suggested
changing the calculation to return only two decimals. There
is a fundamental conflict here because you can not edit a
calculated value so I really don't understand where all this
is going.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

value entryfield changes 1
entryfield linked to selectionlist 1
#name? 1
entryfields 4
schoolyear 3
next record please 6
sending data to multiple people 11
counting time 1

Top