1. ## Rounding

I'm using access 97 and most of my number fields are for Italian Lira such as 55,456,789 I would like to round up to 55,457 but have had no luck yet, any help would be much appreciatd thanks in advance

2. ## Re: Rounding

Try

(Lira+500)1000

Note that is the integer division operator (i.e. it does division and throws away the fractional part).

3. ## Re: Rounding

Hi Douglas thanks for your quick response to my problem,If I tell you I am very new to access you will understand when I say I had difficulty in applying the format you posted for me because when I enter it Access puts in quote marks and turns it to text, sorry if I sound a bit stupid

4. ## Re: Rounding

Are you trying to populate a field or a variable? Are you working with values from a field or a variable? If you have a field called Lira, with a value of 55,456,789 and you want to assign the value rounded to the nearest 1000s to a variable, you would do it like this:

<pre> Dim lngLira As Long
lngLira = ([Lira]+500)1000</pre>

The 500 you're adding to the value in [Lira] is to force a round up. Does that make it clearer?

5. ## Re: Rounding

What Douglas gave you is not a format, it is a formula to calculate the rounded value. You can not use formats to round field values. The foumula could go in a number of places, depending on exactly how you want thing to work. It could go in the query or the beforeupdate event procedure when the value is put into the field in the table. It could go in the query that retrieves the value from the table, or it could go into code that puts the value into control on a form or report.

6. ## Re: Rounding

You are on the right track to understand what I am trying to do but as yet I have had no succes, I tried to use the formula in query but I could not get it to work.

7. ## Re: Rounding

This works for me:

8. ## Re: Rounding

Hi Legare thanks for trying to help me with my problem, as a layman I probably misled you
I have attached a Jpeg the field I'm trying to formulate the field in question is marked in red
and the formula that creates this field is =[Embedded43].[Form]![lira net price]

Thanks again

9. ## Re: Rounding

Try changing that to:

<pre>=([Embedded43].[Form]![lira net price]+500)1000
</pre>

10. ## Re: Rounding

Hi Legare

You're a genius, it worked fine thank's a lot